Loading a form at a specified record problem (1 Viewer)

NoSmoke

Registered User.
Local time
Today, 15:00
Joined
Nov 10, 2012
Messages
99
I have a report that summarizes the record content that is contained within a form (one report line per form record). If the user wishes to view a specific record on the form, he clicks on the report control that contains a numeric value that identifies the record on the form. I can get that to work with the following code:

Code:
DoCmd.OpenForm "AdmissionForm", acNormal, , "[Admission Number] = " & Me.Text0

where Admission Number is a control on the form and Text0 is the control on the report containing the admission number requested i.e. if the report control Text0 = 10, the form would open with the current record in which admission number = 10.

Problem is though, the form opens as "filtered" with only the one requested record (i.e. record number 1 of 1). What I would like is the unfiltered form to be opened with the requested Admission Number as the current record. I have tried DoCmd.GoToRecord but can't get it to work.

Can anyone please help with this?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:00
Joined
Feb 19, 2013
Messages
16,668
I have tried DoCmd.GoToRecord but can't get it to work.
What do you mean? it generates an error, goes to the wrong record, does nothing?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:00
Joined
Aug 30, 2003
Messages
36,133
Happy to help!
 

NoSmoke

Registered User.
Local time
Today, 15:00
Joined
Nov 10, 2012
Messages
99
What do you mean? it generates an error, goes to the wrong record, does nothing?

Sorry CJ, I should have been more specific. The statement I concocted gave a run time error message. I have since erased it as I couldn't figure out the syntax and can't recall just what the message was.
 

Users who are viewing this thread

Top Bottom