Excel Macro

northy
08-06-2001, 07:36 AM
I am using an Excel macro to automate a query from Access but have a bit of a problem... everything works fine when I am using the hardcoded values as selected in the query wizard e.g.

`Milestones Stuff`.`Project Ref`=3

However, what I really want to do is change these values depending upon other conditions something like this:

Dim myvariable As Integer
myvariable = 6

`Milestones Stuff`.`Project Ref`= myvariable

This doesn't seem to work at all since the query does not return any data. Can you do this kind of thing in VBA? If not what other way can you change macros dynamically?

Thanks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum