Search results

  1. J

    how to use OR in vba

    Perfect, Plog - Thanks for the explanation arnelgp - Thanks for the code
  2. J

    how to use OR in vba

    This was working then i changed my form slightly because of an unrelated issue. i'm now getting the error "invalid use of null" using the following code, ElseIf Me.VisitorType = 3 And CDate(IIf(Me.LastTrainingDate = "", Date, Me.LastTrainingDate)) < Date - 180 Or Me.VisitorType = 3 And...
  3. J

    You must save the current field before you run the Requery action.

    I ended up putting the additional fields in an unbound combo box tied to another query which update as i type in the name. it turned out better this way anyway.
  4. J

    You must save the current field before you run the Requery action.

    Your right. i misunderstood what you said. i went through i started over using the following concept frm1 w/ subfrm1 Private Sub VisitorName_NotInList(NewData As String, Response As Integer) Dim oRS As DAO.Recordset, i As Integer, sMsg As String Dim oRSClone As DAO.Recordset...
  5. J

    You must save the current field before you run the Requery action.

    Ok got it, I copied the combo box to the 2nd form and put this on my submit button for the form. Private Sub Command25_Click() Me.cbovisitorname.Requery DoCmd.RunCommand acCmdSaveRecord DoCmd.Close acForm, "frmVisitorInfo" End Sub So now when the form closes and i'm back to my first form...
  6. J

    You must save the current field before you run the Requery action.

    i'm using multiple fields on the persons profile which aren't always necessary. My combo box is 4 fields, VisitorID, VisitorName, VisitorOrganization, VisitorTrainingDate. if the person is a visitor then the name is the only thing required. there is different criteria if it is a contractor...
  7. J

    You must save the current field before you run the Requery action.

    Private Sub VisitorName_NotInList(NewData As String, Response As Integer) Response = MsgBox("This visitor has never signed in before, Would you like to create a new profile?", vbYesNo + vbQuestion, "Client Prompt") If Response = vbYes Then DoCmd.OpenForm "frmvisitorinfo", , , , acAdd...
  8. J

    You must save the current field before you run the Requery action.

    hi, Im having an issue with a not in list event for a combo box. i have frm1 with subfrm1 subfrm1 has a combo box with a list of names. if the name is not in the table then trigger not in list event and open form 2. User enters name etc in form 2 then hits submit. i'm trying to requery the...
  9. J

    Adding names to a table from a visitor log book for future use

    Do you have a file for expected visitors or do people just... show up... as the norm? There is no file except a generic schedule/calender What is the normal flow for people coming and going? Do they normally schedule to come in first? As you are automating this, will you need to report on...
  10. J

    Time difference between two times

    HI, I'm using the following to display the difference in time in minutes =DateDiff("n",[timein],[timeout]) My question is how do i use it to display in either decimal hours- 1.5 hours hours and minutes - 1:30 for 1 hour 30 minutes
  11. J

    how to use OR in vba

    I actually had to add one more line in because if visitor type = 1 or 2 and the training date was empty i would still get the message box. If Me.VisitorType = 3 And CDate(IIf(Me.TrainingDate = "", Date, Me.TrainingDate)) < Date - 180 Or Me.VisitorType = 3 And Me.TrainingDate = "" Then
  12. J

    Adding names to a table from a visitor log book for future use

    it can vary, maybe 10-15. I have a visitor type table which determines, Visitor - Someone visiting Vendor - Someone Providing a service or delivery Contractor - Someone performing work
  13. J

    how to use OR in vba

    Perfect thank you.
  14. J

    how to use OR in vba

    TrainingDate is a text box with short date formatting using the following control source =VisitorName.column(3) This worked before, If Me.VisitorType.Value = 3 And CDate(Me.TrainingDate) < Date - 180 Then MsgBox "This contractor requires training" End If End Sub then i realized i also need...
  15. J

    how to use OR in vba

    It's just something i stumbled across that worked until i tried to add another criteria. i wasn't sure how it worked. also the code worked if the field had a date but if it was empty i got the same type mismatch error
  16. J

    how to use OR in vba

    Hello, I'm trying to use the following statement from a continuous form but im getting a type missmatch error Private Sub VisitorName_AfterUpdate() If Me.VisitorType.Value = 3 And CDate(Me.TrainingDate) < Date - 180 Or CDate(Me.TrainingDate) = "" Then MsgBox "This contractor requires...
  17. J

    Adding names to a table from a visitor log book for future use

    On another note this raises another question for me, is it possible to use a lookupfield that can be typed in to suggest names in the database but doesn't actually allow scrolling through the names?
  18. J

    Adding names to a table from a visitor log book for future use

    Currently visitors sign themselves in using a paper log. The plan is that the receptionist shall sign in all visitors using the database and verify if they have been trained or not within a certain time frame. if they haven't been trained within this period the database will notify the...
  19. J

    Adding names to a table from a visitor log book for future use

    If the visitor has the same name as another visitor of a different company then they should be treated as a new visitor and thus pop up the form to add new visitor information. if they are the same person now working for a different company it should be treated the same way.
  20. J

    Adding names to a table from a visitor log book for future use

    Good point, Maybe if the user types their name into the visitor field and the user is not found it would give a message box to open a form and create a new visitor?
Back
Top Bottom