FORMS USED FOR UPDATING DATA BASE

  • Thread starter Thread starter Loren Holmes
  • Start date Start date
L

Loren Holmes

I would like to create a form that can be used to update
the data base - not just enter the new data. I would
prefer not to have to use the find commmad as it is a
rather large data --over 300,000 items. Is this possible
with Access 2000 ? When I key in an existing number it
does not search for that record it simply overwrites the
catalog number -- and that is it.

Loren Holmes
 
Loren, you need to use a different text box - an unbound one - to find the
record that needs editing.

Typically this "find" box would go into the Form Header section of the form.
Use its AfterUpdate event to find the record.
 
Your mistake is in trying to use a Bound Control as a way
of searching the database. What you should do is create an
Unbound Control (i.e. one who's ControlSource is not set),
then use its AfterUpdate eventHandler to filter the form to
the record(s) that you you want.

Try something along the following lines
Create a TextBox called SearchCatalogueNumber then in the
AfterUpdate eventHandler, type in

DoCmd.ApplyFilter ,"{yourCatalogueNumerColumnName} = " &
SearchCatalogueNumber.Value

When replacing {yourCatalogueNumerColumnName} in the above,
take out the {} as well. They are only in there to
highlight the change you need to make.

Hope This Helps
Gerald Stanley MCSD
 
When your file gets that large, then you NEVER simply want to open up a form
attached to a table without regards to WHAT record will be loaded.

I would built a un-bound form that asks for the invoice number, part number
(or whatever your users typically search by).

Then, in the after update event of this text box, you simply go:

dim strWhere as string

strWhere = "[PartNumber] = '" & me.txtSeachBox & "'"

docdm.openForm "MainEdit",,,strWhere


The above code will open the form to the correct record. When the user is
done, they close the form and now are right back to the nice prompt form you
made.

You can also add some code in the forms on-open event to check if the record
exists, and give a message if it does not.

if me.recordsetClone.RecordCount = 0 then

msgbox "Record not found, try again"
cancel = true

endif

And, as your coding skills get better...then I would suggest you search for
data as follows:

http://www.attcanada.net/~kallal.msn/Search/index.html
 
Back
Top