Userform to query access database and return specific result & then update database

DodoRevival

New Member
Joined
Apr 19, 2012
Messages
30
Hi Guys

I have been trying to work this out all day with no success and wondered if anyone here could help me out. I'm not usre if this is the right place to post or if it should be in the access section as its a bit of both.

I have a database called records with a table called Remedial_Action

There are 5 fields called ref, further investigation, investigation notes, date required & complete

I have a userform with 2 text boxes and 2 command buttons (retrieve & Submit)

what i want to do is the user inputs a reference number into text box 1 and click on the retrieve command button. this querys the database for the matching ref and returns the notes in textbox 2. i want the user to be able to update the notes and then click the submit button which will then update the database with the revised notes and mark the complete field as yes. I'm sure this is possible but im just not getting it.

thanks in advance
 
It should be a yes/no field or some kind of boolean. It shouldn't be text.

Change it to yes/no then the sql will work :)
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
All sorted

thanks again Kyle

One final thing i would like to do with this is when i am doing the retrieval as in the first code i posted is there a way to get an exception message when the reference entered is not in the database?

Thanks
 
Upvote 0
Wouldn't the ref number always be right if they are editing a returned record?
 
Upvote 0
Basically the people updating would be recieving an email to advise that remedial action has been taken and that email will have the reference number on it. They just type it in and call up the notes to update and mark as complete. I'm just wondering if we can get a warning message if they type in an incorrect ref number as invariably if you give people the chance to type things in you will get some who get it wrong.

Thanks
 
Upvote 0
Your search returns Ref as well as the notes. Compare the returned Ref to tbSearch.Value. If they are not the same then process the error.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top