selecting form data

G

Guest

Hi
i have a form which I have wriiten following code to prompt user to enter
desired code but I would also like to show all records where field
assesment_number is not blank ??.
private sub form_loas()
dim mycode as string
mycode = inputbox("please enter code")
me.code.set focus
docmd.findrecord mycode
end sub
 
J

Jeff Boyce

Tina

If your user is required to know and enter a code in order to find a record,
you are putting the burden on your user.

An alternate approach is to use something like a combo box to list all
available codes (and their descriptions), and allow the user to enter or
select. This approach also allows you to prevent the entry of an invalid
code (using the LimitToList property), or allow the user to create a new
code, using the NotInList property. Note: you'd have to alter this
approach if you had thousands of codes.

Calling up the selected code/record can be handled by setting the query that
fills the form to use the code in the combo box as a criterion, and by
requerying after updating the combo box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top