New Records on Dialog Box

Oh, I'm sorry. I thought you were asking me how to set up the Default Value. In reality, you were asking how to filter the form if VendorID was a text field. In that case, try the following instead.
Code:
DoCmd.OpenForm "VendorContacts", acFormDS, , "Me.VendorID='" & Nz(Me.VendorID,0) & "'", , , Me.VendorID
 
It is giving me an error asking to type in the VendorID
 

Attachments

  • Capture.JPG
    Capture.JPG
    30.2 KB · Views: 82
Sorry, my mistake. I got mixed up when I got confused about your last question. Please try the following instead.
Code:
DoCmd.OpenForm "VendorContacts", acFormDS, , "VendorID = '" & Nz(Me.VendorID, 0) & "'", acFormEdit, acWindowNormal, Me.VendorID
 
Excellent... one last thing (hopefully!)

The default value in the VendorContacts Form is also defaulting to number (for more complex text ones it will be a problem)

How do you change this one to a text value?

Code:
Me.VendorID.DefaultValue = Me.OpenArgs
 
Excellent... one last thing (hopefully!)

The default value in the VendorContacts Form is also defaulting to number (for more complex text ones it will be a problem)

How do you change this one to a text value?

Code:
Me.VendorID.DefaultValue = Me.OpenArgs
Okay, that would be the code I gave you earlier (see post #19) because that's what I thought you were asking me in the first place.
 

Users who are viewing this thread

Back
Top Bottom