Search results

  1. stopher

    What on earth have I done!

    The form's "Data Entry" property has been set to "Yes". This mean the form is now only for new data entry i.e. a blank form. Set it to "No" and you will see many records.
  2. stopher

    Strange month behavior when formatting "mm"

    Try: Format(Date(), "mm")
  3. stopher

    Excel (VBA?)- copy and paste 2 consecutive uppercase characters in string, if present

    Oops, though it was all alpha, my bad. Try: Public Function getState(aString As String) As String Dim i As Integer getState = "" i = 1 Do While i < Len(aString) And getState = "" If Asc(Mid(aString, i, 1)) >= 65 And Asc(Mid(aString, i, 1)) <= 90 Then If...
  4. stopher

    Excel (VBA?)- copy and paste 2 consecutive uppercase characters in string, if present

    Please show an example string and the result you got when you tried the function.
  5. stopher

    Excel (VBA?)- copy and paste 2 consecutive uppercase characters in string, if present

    You could create a custom function like this: Public Function getState(aString As String) As String Dim strLength As Integer Dim i As Integer strLength = Len(aString) getState = "" i = 1 Do While i < strLength And getState = "" If Mid(aString, i, 2) =...
  6. stopher

    How to know if database is corrupted?

    Are you on a network or standalone pc? Is your database split be/fe?
  7. stopher

    Bof & eof?

    One example might be that you are a tour operator. The function generates tickets. So you loop through all your tours and pass a recordset of all the people booked on the given tour. Of course some tours might not have any bookings. That's fine because the function sees the empty recordset and...
  8. stopher

    Help with DLOOKUP

    Try: recID = DLookup("[ID]", "RECIPES", "RecipeName = '" & Me.txtRecipe & "'")
  9. stopher

    Bof & eof?

    Agreed it's easy but imho not good coding. If you code the way you suggest then you are relying on everyone who ever uses the function to know that they must movefirst. A good function should deal with this. Would you write a function that took a string as an input without testing for an...
  10. stopher

    Bof & eof?

    What Frothingslosh says makes sense and I am intrigued when we might do this. Consider: Public Sub test() Dim db As Database Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.OpenRecordset("tblSomeData") Do While Not rs.EOF Debug.Print rs(1)...
  11. stopher

    Error Handling

    The point is if you try to read one of the mail objects properties then either.. the object no longer exists and therefore an error is thrown. If the object no longer exists then it has been sent. So detecting an error means it has been sent. Or a result is given when reading a property of...
  12. stopher

    Why is that so?

    I agree it's difficult not to be cynical these days. Who is Donald Trump? (googling)
  13. stopher

    What the employers will think?

    Be aware that there are significant cultural differences between the various contributors to this thread. One model of measuring cultural difference (between countries) comes from Geert Hofstede. Take a look at the POWER DISTANCE dimension and the dialogue for the UK...
  14. stopher

    Why is that so?

    So you leapt the other way :rolleyes:
  15. stopher

    Why is that so?

    Googling to search for events is not the same as hearing about events. prabha_friend's point (I think) is that it is not common news which The_Doc_Man has picked up on. He is not saying that it has never happened.
  16. stopher

    Error Handling

    Maybe the post at the bottom of this thread will help: http://www.access-programmers.co.uk/forums/showthread.php?t=199135 I haven't tried it myself.
  17. stopher

    Update textbox after looping through table

    Any reason why you are not using DCount for example? Something like: DCount("taskID","qryProjectTasks","projectID=" & forms!myForm!projectID & " AND status<>'Completed') Wrap the above in an iif statement e.g. IIF(DCount("taskID","qryProjectTasks","projectID=" & forms!myForm!projectID & "...
  18. stopher

    Get current subform control (container) name

    IMHO, a property accessor method (Get/Let(set)) is used when the data for the property is intended to be exposed outside the class object (the principle of encapsulation). So the block beginning "Property Get Subforms() As VBA.Collection" exposes Subforms() outside of the subform object. I...
  19. stopher

    Get current subform control (container) name

    Taking MarkK's code we can eliminate the collection and just reference the container relevant to the subform: Private subCont As Control Private Sub Form_Load() Dim ctrl As Control For Each ctrl In Me.Parent.Controls 'find the subform, and reference it If...
  20. stopher

    Get current subform control (container) name

    I was referring to the OPs comment: My concern is the OP may not be aware that an object does not need to know its name or reference to refer to itself. Granted we are all interested in solving problems regardless of their direct value.
Back
Top Bottom