Open form to specific record based on text box on navigation form (1 Viewer)

Sticky99

Registered User.
Local time
Yesterday, 22:16
Joined
Nov 9, 2019
Messages
61
Hi Guys, I'm trying to open a form to a specific record, I have a navigation form with a button and text box where i can input the specific record number, although the form opens, it always opens to a new record, I'm using the following to open the form.

DoCmd.OpenForm "frmDeliveryNote", acNormal, "", "[DeliveryNoteID]=[Forms]![frmDNote]![txtSearchDNote]", , acNormal

can anyone throw some light on why the from doesn't open to the specific record.

Cheers
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:16
Joined
Oct 29, 2018
Messages
21,528
Hi. On a different note, have you tried using the BrowseTo method instead?
 

Sticky99

Registered User.
Local time
Yesterday, 22:16
Joined
Nov 9, 2019
Messages
61
Hi Gasman,
is this what you mean

DoCmd.OpenForm "frmDeliveryNote", , , "[DeliveryNoteID]=[Forms]![frmDNote]![txtSearchDNote]"
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:16
Joined
Sep 21, 2011
Messages
14,417
Hi Gasman,
is this what you mean

DoCmd.OpenForm "frmDeliveryNote", , , "[DeliveryNoteID]=[Forms]![frmDNote]![txtSearchDNote]"
Yes, but you should only have two commas I believe.? Check that syntax link I posted.
 

Sticky99

Registered User.
Local time
Yesterday, 22:16
Joined
Nov 9, 2019
Messages
61
If you can show us how you tried it, maybe we can show you how to fix it.
This is what I have
DoCmd.BrowseTo acForm, "frmDeliveryNote", "", "[Forms]![frmDeliveryNote]![DeliveryNoteID]= [forms]![DNote]![Text1]", "", 1
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:16
Joined
Oct 29, 2018
Messages
21,528
This is what I have
DoCmd.BrowseTo acForm, "frmDeliveryNote", "", "[Forms]![frmDeliveryNote]![DeliveryNoteID]= [forms]![DNote]![Text1]", "", 1
Hi. I think maybe that should have been more like:

Code:
DoCmd.BrowseTo acBrowseToForm, "frmDeliveryNote", , "DeliveryNoteId=" & Me.TextboxName
 
Last edited:

Sticky99

Registered User.
Local time
Yesterday, 22:16
Joined
Nov 9, 2019
Messages
61
Hi. I think maybe that should have been more like:

Code:
DoCmd.BrowseTo acBrowseToForm, "frmDeliveryNote", , "DeliveryNoteId=" & Me.TextboxName
Thank You!!! it worked.
Thanks DBguy,
Much appreciated, I can sleep tonight.
Really great to be able to call on you guys for help.

Again, thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:16
Joined
Oct 29, 2018
Messages
21,528
Thank You!!! it worked.
Thanks DBguy,
Much appreciated, I can sleep tonight.
Really great to be able to call on you guys for help.

Again, thanks.
Hi. You're welcome. Glad we could assist. Good luck with your project.
 

Users who are viewing this thread

Top Bottom