one of my wee problems again......

lynsey2

Registered User.
Local time
Today, 16:18
Joined
Jun 18, 2002
Messages
439
Private Sub SelectDrugs_Click()
Reset_Text
Dim Ref As Integer
Dim MyRS As DAO.Recordset
Dim MySearch As String
Set MyRS = CurrentDb.OpenRecordset("his2", dbOpenDynaset)
Ref = Me.SelectDrugs.Column(0)
MySearch = "[Ref]=" & Ref
MyRS.FindFirst MySearch
Forms!ARTScript!pickDrug1 = MyRS("Drug")
Forms!ARTScript!pickForm1 = MyRS("Form")
Forms!ARTScript!pickFrequency1 = MyRS("Frequency")
Forms!ARTScript!pickStrength1 = MyRS("Strength")
MyRS.Close
DoCmd.Close
End Sub


this is the code im having problems with!!!!

think its this line

Dim MyRS As DAO.Recordset

any clues would be more than helpful... im half way to stratheden!!!
 
Might be a reference thing - have you fixed your DAO references.

Also, these lines

Forms!ARTScript!pickDrug1 = MyRS("Drug") etc

Can you do that?

I always use:

Forms!ARTScript!pickDrug1 = MyRS.Fields("Drug")
 
Might be a reference thing - have you fixed your DAO references.

what do you mean?

i dont think it makes a difference doing the (.Field) bit i tried using it and still got the same error!
 
By DAO references, open a module, goto Tools -> References

Ensure that Microsoft DAO Object Library 3.5 is above any ADO references

That might be the problem, if it's something else I don't see it.
 
TA!
I have done that before but io must have clicked it off again!:rolleyes:
 

Users who are viewing this thread

Back
Top Bottom