Log in

View Full Version : Update Query/ComboBox Access Issue



AdrianK
01-31-2008, 06:08 AM
Hello All,

I have created a query as follows to input a value into a table to be used by a form:

UPDATE temp
SET TempVal = [GROUP]
WHERE TempVal = 'TEMP';

However, I now need to use this query to update the TempVal from a ComboBox on a form, rather than the popup.

I have set the ComboBox (Named ComboReportGroup) up to draw values from a table (Named Group), but am unsure how to code the VBA for a button to run this query, replacing the [GROUP] input with the selected value from the ComboBox.

If you could help it would be most appreciated.

Many thanks,

Adrian

rconverse
01-31-2008, 07:29 AM
strsql = "UPDATE temp SET TempVal = """ & [Forms]![FormName]![ComboReportGroup] & """ WHERE " _
& " TempVal = TEMP';"


HTH
Roger

AdrianK
01-31-2008, 09:30 AM
Thanks that's great!!