Update table from unbound form

thescottsman

Registered User.
Local time
Today, 01:30
Joined
Sep 18, 2014
Messages
42
Hi All

I have a form, which has a search box. This allows you to search through the id numbers of each record. Once an ID has been selected a bound textbox displays the id number. Other unbound textboxes then display other information from the table with the relavaent record.

What I want to do is then allow users to change information in textboxes and update the record. I cant seem to find a way to do this.

I understand vba to a limit but am really unsure on sql.

please can anyone help!
 
Why not just send them to a bound form once an ID is selected?
 
Thanks for the reply.

The reason why not is because I want the user to click a button to save the information, also I want this form to update other fields in other tables eventually
 
That's an acceptable answer, it just makes life more difficult for you. What exactly are you having trouble with? Are you able to load the data?

To update the data you will need an UPDATE query (http://www.w3schools.com/sql/sql_update.asp)
 
No I am unable to load the data that matches the id number.

then I want to alter the unbound textboes that have found data from the table and update it
 
Also I have looked through the link you posted about update queries, how would I put this into a vba code?
 
You cannot directly change data via unbound textboxes - that's why they're unbound. You can certainly use VBA or an update query to do it manually, but that's the hard approach.

I think your best option is this: you can create a form based on the recordset you want, add an unbound combo-box that allows you to search the ID numbers, and an after-update event on that combo box that moves to the selected record after the user enters the ID they want. If you're using Access 2007 or newer, the combo-box wizard has an option to set that up automatically.
 
No I am unable to load the data that matches the id number.

No offense but what you want, may be too much for what you are capable of. You've got to complete 2 intermediate level tasks (load data and update data) to get this working and you're stuck on the first one which is the easier one.

I wouldn't worry about my UPDATE code, you need to first load the data to the form. My advice is to work through a few Access tutorials get a base understanding of it and then give it a shot.
 

Users who are viewing this thread

Back
Top Bottom