Access is fun Errors arent. SEARCH probs.

da poet

Registered User.
Local time
Today, 17:41
Joined
Aug 23, 2004
Messages
39
Private Sub quicksearch_AfterUpdate()


Dim db As DAO.Database
Dim rs As DAO.Recordset

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID number] = " & Str(Me![quicksearch])
Me.Bookmark = rs.Bookmark

End Sub


this is the code that im using to help me with a listbox and a search text box that is embedded on my main form. it works ok. The problem is, i was trying to link an already filled out Table with data to this interface.

When i key in information from the form it works, but when i just enter stuff through the table (which was already completed and handed to me) When I click in the listbox on the main form the code window just pops up showing this section of my code. Help./

Help.
 
You were trying to link your textbox to that table or the listbox to that table? Where is your search starting from on your form, and why is this in the after update event rather than being triggered by a command button?
 
So are you saying that i should create a button. Im not good at this. I just search the forums and copy codes from the attachments and they always seem to work. Yes the listbox is connected to my table that is where it takes the data from and displays it. The thing is that it does work when i key in information directly from the interface and try and search using the listbox, but when i just link the table with the already entered data it generates some errors in the process.

What would codes for a button like that look like?
 
Any Ideas?

Im still no closer to getting around this problem, the thing is though ive done some reading and based on the error message and the line of code that was highlighted i realise that its something to do with the DAO. My question though is how do i get this to not only work when i feed information to the table through the form but also when i just try and add records from already existing tables. I have a table with about 2000 plus records already, i just wana put them in the database and call this a a day.

By the way the codes i used were taken from some search examples that i found on this website.

As i said, this form works perfectly, its only now that im trying to add already existent data to the table from another table that im running into trouble.

The exact problem is the records when updated to the table that the listbox looks up from they are displayed, but when i try to click in the record box the re is an error. soemthing about User-defined error.
 

Users who are viewing this thread

Back
Top Bottom