hytekth
asked on
DoCmd.GoToRecord - Access2000
I'm sure this is easy but I can't figure it out!
I'm running a Listbox of records which display all record from a given company, this is on a seperate form from the actual infomation for each record.
I'm trying to open up the specific record that a user selects but I can't make it open the right record. So far the code looks like:
Private Sub UpdateClaimBtn_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim SelectedRec As String
SelectedRec = List9.ItemData(List9.ListI ndex + 1)
' use to work out the record ID of the users selection
stDocName = "Claim_Table"
DoCmd.OpenForm stDocName, acViewNormal
DoCmd.GoToRecord Record:=Forms![UpdateClaim Form]!Faul tID(Select edRec)
End Sub
Ideally I would like to open the corrisponding "FaultID" record on the Claim_Table form.
Any ideas or advice would be wonderful!
I'm running a Listbox of records which display all record from a given company, this is on a seperate form from the actual infomation for each record.
I'm trying to open up the specific record that a user selects but I can't make it open the right record. So far the code looks like:
Private Sub UpdateClaimBtn_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim SelectedRec As String
SelectedRec = List9.ItemData(List9.ListI
' use to work out the record ID of the users selection
stDocName = "Claim_Table"
DoCmd.OpenForm stDocName, acViewNormal
DoCmd.GoToRecord Record:=Forms![UpdateClaim
End Sub
Ideally I would like to open the corrisponding "FaultID" record on the Claim_Table form.
Any ideas or advice would be wonderful!
ASKER
I tried
DoCmd.GoToRecord Record:= Forms!UpdateClaimForm.Reco rdset.Find First "FaultID = " & SelectedRec
But it came up with a Expected: end of statement arround the "FaultID = " section :-/
DoCmd.GoToRecord Record:= Forms!UpdateClaimForm.Reco
But it came up with a Expected: end of statement arround the "FaultID = " section :-/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant! Works like a charm :-) Thank you very much!
Glad to help!
Good luck with the rest of your project(s)
Dave
Good luck with the rest of your project(s)
Dave
> DoCmd.GoToRecord Record:=Forms![UpdateClaim
Rather than that, try:
Forms!UpdateClaimForm.Reco
Dave :-)