Ask Your Question

access2base - FindRecord, only for numbers? [closed]

asked 2016-05-12 22:06:48 +0200

Michel_1495 gravatar image

updated 2016-05-12 22:11:51 +0200

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


  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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Michel_1495
close date 2016-05-16 23:36:58.187239


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 gravatar imageJPL ( 2016-05-14 11:36:54 +0200 )edit

JPL gravatar imageJPL ( 2016-05-14 11:39:24 +0200 )edit

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

Michel_1495 gravatar imageMichel_1495 ( 2016-05-16 23:36:10 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2016-05-15 19:34:59 +0200

JPL gravatar image

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.


edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-05-12 22:06:48 +0200

Seen: 57 times

Last updated: May 15 '16