New Records on Dialog Box (1 Viewer)

theDBguy

I’m here to help
Staff member
Local time
Today, 02:57
Joined
Oct 29, 2018
Messages
21,477
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
 

fedebrin

Registered User.
Local time
Today, 02:57
Joined
Sep 20, 2017
Messages
59
It is giving me an error asking to type in the VendorID
 

Attachments

  • Capture.JPG
    Capture.JPG
    30.2 KB · Views: 48

theDBguy

I’m here to help
Staff member
Local time
Today, 02:57
Joined
Oct 29, 2018
Messages
21,477
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
 

fedebrin

Registered User.
Local time
Today, 02:57
Joined
Sep 20, 2017
Messages
59
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:57
Joined
Oct 29, 2018
Messages
21,477
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

Top Bottom