access2base - FindRecord, only for numbers?

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

No, FindRecord is not limited to numbers. Strings and dates are allowed as well.

Are you sure that iZoek does not contain Null ? Or that ocControl.Value does return a non-Null value ?

JPL


OK. I will create a workaround in the meantime by adding radiobuttons, number search or string search.
Thanks.

OK. This is now precise enough to diagnose a bug in Access2Base when searching in some circumstances a string in a numeric field.
I will provide a correction for LO 5.2.
In the meantime try to limit the search of strings to string columns and numbers to numeric fields.

Sorry for the inconvenience.

JPL