update query

Joanna_gr

Board Regular
Joined
Feb 16, 2002
Messages
149
I'm not sure if this is possible to be done, but I wonder if it is possible for a user to programmticaly select the field of an update query and the "update to". What I have is a table with many fields of yes/no. Each time I want to update different column but instead of creating hundreds of update queries I would like to being asked what is the field I prefer to have and where to update.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi Joanna
I don't think you can do this with an update query (although I would be happy to be proved wrong). Possibly VBA is an option? (that is not my forte) How many different yes/no fields do you have?
Andrew :)
 
Upvote 0
Hi

The only way that I can think of to do this is through VBA and changing the QueryDef (query definition) object for your query on the fly - not too difficult but (as always) depends on a number of factors (e.g. how many people are likely to be using the DB at the same time - you don't want to change the query definition while someone else is using it etc; how comfortable you are with VBA etc).

Martin
 
Upvote 0
just create the SQL in code and run it from code no need to use a saved query at all.
How to do it will depend on the structure that you have/need

Peter
 
Upvote 0
well to be honest i don't know much about VBA. In fact I have no idea how to do such thing to work... I hope you can help me more on this. And to answer the previous message only one uses the db each time.
Thank you
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

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