lynsey2
Registered User.
- Local time
- Today, 04:33
- Joined
- Jun 18, 2002
- Messages
- 439
cant seem to work out how to fix this code to work for me does anyone have a clue??
Private Sub SelectDrugs_Click()
Dim Ref As Integer
Dim MyRS As Recordset
Dim MySearch As String
Set MyRS = CurrentDb.OpenRecordset("his2", dbOpenDynaset)
Ref = Me.SelectDrugs.Column(0)
MySearch = "[Ref]=" & Ref
MyRS.Find MySearch
Forms!ARTScript!pickDrug1 = MyRS("Drug")
Forms!ARTScript!pickForm1 = MyRS("Form")
Forms!ARTScript!pickFreq1 = MyRS("Frequency")
Forms!ARTScript!pickStrength1 = MyRS("Strength")
Forms!ARTScript!txtIssued = MyRS("Date_Issued")
End Sub
i have a form with 2 list boxes on it, in the 2nd list box i have this code in the on_click event and i want the Drug, form, freq and strength from the 2nd list box to fill out text boxes in another form (ARTScript) i dont have a clue if im on the right lines so if anyone can help that would be great!
Thanks a million,
Lyns
Private Sub SelectDrugs_Click()
Dim Ref As Integer
Dim MyRS As Recordset
Dim MySearch As String
Set MyRS = CurrentDb.OpenRecordset("his2", dbOpenDynaset)
Ref = Me.SelectDrugs.Column(0)
MySearch = "[Ref]=" & Ref
MyRS.Find MySearch
Forms!ARTScript!pickDrug1 = MyRS("Drug")
Forms!ARTScript!pickForm1 = MyRS("Form")
Forms!ARTScript!pickFreq1 = MyRS("Frequency")
Forms!ARTScript!pickStrength1 = MyRS("Strength")
Forms!ARTScript!txtIssued = MyRS("Date_Issued")
End Sub
i have a form with 2 list boxes on it, in the 2nd list box i have this code in the on_click event and i want the Drug, form, freq and strength from the 2nd list box to fill out text boxes in another form (ARTScript) i dont have a clue if im on the right lines so if anyone can help that would be great!
Thanks a million,
Lyns
