L.0. 5.1.2, acces2base 1.4, dbase = mysql, form ( “f_leden”) containing a grid filled with some data from clubmembers.
I want to search for a member by entering some data in a non-linked field “Zoek”, then starting the macro ZoekLid
It works fine as long as I declare “Zoek” as an integer (or i.e. long) & enter an integer number.
But if I declare “Zoek” as i.e. as “string” or “Variant”, I get an error message #13 DataType not matching…
This is the macro which will work fine if I enter a integer number in the control named “Zoek”:
Function ZoekLid
Dim ofForm, ocControl As Object
Dim iZoek as Integer
Set ofForm = Forms("f_leden")
Set ocControl = ofForm.Controls("Zoek")
iZoek = ocControl.Value
ofForm.SetFocus()
If Not FindRecord(iZoek, , , , ,acAll) Then MsgBox "Niet gevonden!"
End Function
What is wrong? Is “FindRecord” limited to this type of data?
Thanks for any help