Form record navigation transferring to next form

nadsys

Registered User.
Local time
Today, 01:44
Joined
Apr 22, 2005
Messages
18
on main form i have 6 buttons to take me to different forms. these other forms display different details relating to the same record im looking at on main form.

SO, i hit the record navigation button and it flicks to show record 2's details, then i hit my button and it takes me to my new form BUT starts from record 1, i want it to show the current record in looking at on main form.

i feel ashamed asking this, must be simple thing to do.

thank you for any advice.
 
do your "other" forms contain the PK (preferably) of the main form? are your "other" forms based on queries? the query should contain the PK of the main form and the criteria of the PK field should be something like [Forms]![frmMain]![PKfield]. this way the records should always line up. if you change records without closing the "other" form, though, you need to requery the "other" form.

- w
 
Record linking code problem

Private Sub WSIPAddressesOpen_Click()
DoCmd.OpenForm "frmWorkStationIPAddresses", acNormal, "", "", acEdit, acWindowNormal
[Forms]![frmPSSName]![PSSName] = [Forms]![frmWorkStationIPAddresses]![PSSName]
DoCmd.Close acForm, Me.Name
End Sub

The OnClick event for the button of my main form is above. When i click on the button i expect it to open my next form with the current displayed record from main form.

currently it opens the new form, but does not display the record information in the text box's of the new form.

can you please help.
 
hi. sry, i "lost the thread", so to speak, and just found it again.

i think this is backward:
[Forms]![frmPSSName]![PSSName] = [Forms]![frmWorkStationIPAddresses]![PSSName]

try:
[Forms]![frmWorkStationIPAddresses]![PSSName] = [Forms]![frmPSSName]![PSSName]

also, if something on the second form has to equal something on the first form, don't close the first form before you open the second, or else the second form won't be able to reference the first. (hide the first form if you like: Me.Visible = False).
 
Last edited:

Users who are viewing this thread

Back
Top Bottom