Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Record Problems

Status
Not open for further replies.

mrchinchin25

IS-IT--Management
Joined
Oct 10, 2002
Messages
15
Location
GB
I'm trying to use DoCmd.FindRecord to find a record which is null. Heres an example:

In the Form, on each record:
I have a textbox called Blank. This is blank (!).
I have a textbox called Thursday Guest.

Now when i click a button (call it find) i want the control to pass to Blank, and then search all the records to bring up the first record with a blank Thursday guest.

so i have:
DoCmd.GoToControl "blank"
DoCmd.FindRecord [Thursday Guest], acEntire, False, acSearchAll, True, acAll

It doesn't work at all, it just does nothing.

Any ideas?
 
How about:

Code:
[Thursday guest].SetFocus
DoCmd.FindRecord vbNullString, , , , True, acCurrent
[Blank].SetFocus
{/code]

This sets the form's focus to the [Thursday guest] field, searches for the first record with a null value in this field and then puts the cursor in the [Blank] field to finish (that's what you wanted, right?).
 
Yeah that should be fine thanks! I'll check it.
 
Hi,
I've just tried the new code, but its coming up with an error:

"The Find Record action requires a Find What arguement"

Now in my original code, I had this line:
DoCmd.FindRecord [Thursday Guest], acEntire, etc

and this brings back the error:
"A macro set to one of the current fields properties failed because of an error in a FindRecord action arguement."

Any ideas???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top