Subform command button makes main form jump to record

MCantu

Registered User.
Local time
Yesterday, 19:00
Joined
Nov 18, 2004
Messages
62
I am a beginner to VBA, I know in general what to do (I think)- I just don't know the syntax.

I have a main form called "frmmain" I have a subform called "history"

History is a continuous form, showing all the records Frmmain has access to.

Frmmain only shows one record at a time.

I would like to know the syntax to DoCmd.GoToRecord on the frmmain form based upon the record in the subform history.


In other words, you scroll down in the subform until you find a record you would like to look at (I have abbreviated the information for a quick visual scan)

Once you find what you want, you would click the command button in the subform and it would cause "frmmain" to jump to that record.

I know this is easy stuff. I can't get the syntax right, and I have not found the right examples in the posts.

I am learning as I go.......

Thank you.
-M
 
Heres my malfunction

I just need to know the syntax. what am I doing wrong ?

This is on a command button on the subform

CMID = Me.CombinedID
Forms![FRMMAIN]![CombinedID].SetFocus
DoCmd.GoToRecord acForm, FRMMAIN.CombinedID, acGoTo, CMID

The field "combinedid" is the same field/info on both my main form "Frmmain" and the subform "History"

I want it to bring the record on frmmain to the same record being displayed on history (where this command button is sitting)

help please!
 

Users who are viewing this thread

Back
Top Bottom