Avatar of rjef
rjef
Flag for United States of America asked on

need help updating new location from combo box into a subform query in access using vba.

update-location-with-combo-box-valu.pptx
update-location-with-combo-box-valu.pptxneed help updating new location from combo box into a subform query in access using vba.  please see attachment.
Microsoft AccessVBA

Avatar of undefined
Last Comment
rjef

8/22/2022 - Mon
Mark Edwards

Your picture gives us a rough idea of what you want to do, so here's a rough idea of how to do it:
Assuming the record you want to update is selected in the subform as seen in the picture and assuming that the name of the Location field textbox is "Location", and assuming that there is a location value is in the combobox when you click the "Update Location" button:

Me.subFormControlNameHere.Form.Location = Me.ComboboxControlNameHere

Open in new window

This is a simple way to do it.  There's are several others, but no need to get any more involved given what we know so far.
Scott McDaniel (EE MVE )

Also, please don't use PowerPoint to provide images. A simple screen capture works much better, and many Experts simply won't open files like this (or don't have or use PowerPoint).
Mark Edwards

I agree with Scott.  
Windows 10 comes with a "Snipping Tool" (found under "Windows Accessories") which is what I use to snag pieces of screens.  
You can save them as files for insertion into EE posts, etc., or paste them into Word, etc.
Also, I got the screenshot of the Snipping Tool below by holding down the Shift key on my keyboard and pressing the "Print Screen" key on my keyboard which puts it on the clipboard, then pasting the screenshot on the clipboard into Word, where I right-clicked on it to "Save As" an image file.  You can also edit the screenshots in Paint or some other image edit app.
If you Google "Snagit", you'll find out it is not free, but you'll also find a few links to quite a few similar apps that are.
TIP:  If the image in EE posts are unreadable, like the one below, click on it to expand it into its own browser window so you can read it.
Windows-Snipping-Tool.png
Your help has saved me hundreds of hours of internet surfing.
fblack61
John Tsioumpris

I use simply Print Screen and IrfanView....Select the Screen portion that you need and CTRL+Y to crop accordingly..CTRL + S to Save
rjef

ASKER
getting the error 'record set not updateable'

break messagerecord set not updateadle
rjef

ASKER
lets change gears here for a second.  maybe I can just do a  docmd.runsql UPDATE Returns SET Location = 'LW0119B' WHERE [ID] = '202'
but I do not understand the format exactly.  Please advise
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
John Tsioumpris

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Mark Edwards

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
rjef

ASKER
my location table is just linked.  I can't add a primary key
rjef

ASKER
how do I know what 'N' is?
rjef

ASKER
let's put this another way
I have a table called 'Returns' it has a few fields on of which is called 'Location' and It has a primary key on a field called 'ID' which is also  auto numbered
on ID record 202 I want the change the location field value to 'test'.  would the below statement work. if not how do I format it to work (If possible)


docmd.runsql UPDATE Returns SET Location = 'test' WHERE [ID] = '202'
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
rjef

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Mark Edwards

"this worked" means you got what you needed - problem solved, right?
rjef

ASKER
yes thanks for the help