continuous form wont link

tubar

Registered User.
Local time
Today, 13:04
Joined
Jul 13, 2006
Messages
190
I have a continuous form that wont open another form with the onclick expression when there is criteria.
Code:
stDocName = "frmITEMSEARCH"
    stLinkCriteria = "[ID]=" & Me![id]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

is there a setting i am missing?
 
go to debug mode and see if you can fix it.
 
the command is correct, so either:
the text box called ID is not named this
or
the ID is not filled in the textbox. (or connected to the field)

(you dont need the ME, me.ID)
DoCmd.OpenForm "frmITEMSEARCH", , , "[ID]=" & ID

(i ALWAYS label my text boxs with txt to distinguish fields from textboxs)
"[id]=" & txtID
 
thanks for the tip on the textbox naming... iw ill follow that from now on. when i click the third record in the continuous form i notice the id in the first record is highlighted. when the next form opens it pulls the record from that id. is there something i could add in my code to activate the id in the record i slect. sorry if that doesnt make sense
 
when i click on a record in continuous form its taking the id from the first record to link to the form i open. so i tried this code
Code:
Private Sub Image15_Click()
myrecnum = Me.CurrentRecord
ID.Requery
 DoCmd.GoToRecord , , , myrecnum
 ID.SetFocus
 
stDocName = "frmITEM"
    
    stLinkCriteria = "[id]=" & Me![ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
thinking it would take the id of the record i click. however, it just goes to the next id everytime i click a record. exaple i click record five id 1 is criteria i click record 20 id 2 is criteria i click record 60 and id 3 is criteria and so on
 
just remove those first 4 lines in your code.
 

Users who are viewing this thread

Back
Top Bottom