Hi,
Im not sure if I have the terminology correct, but heres the situation.
I have a list box on a form, when the user selects dates in the list box, the after update event creates part of an sql string, and adds it on, known as MonthSql. The sql output looks something like this: 01/01/03 OR 01/02/03 OR 01/03/03 etc etc depending on what the user selects.
MonthSql is then added on the end of two sql strings, a select and update. These strings then need to be executed when a command button is clicked.
The problem I’m having is making the MonthSql string global to be available in either a module function, or a command button.
If I debug.print monthsql in a function, or on a command button it isn’t showing the string at all, so I guess other objects cant see the string because its in the afterupdate event of the list box..
Question is, how can I make the string monthsql available to other objects? I don’t want to go down the route of creating a query in the sys table and then executing it etc, id rather use currentdb.execute(selectsql) etc.
Thanks in advance. Elliot.
Im not sure if I have the terminology correct, but heres the situation.
I have a list box on a form, when the user selects dates in the list box, the after update event creates part of an sql string, and adds it on, known as MonthSql. The sql output looks something like this: 01/01/03 OR 01/02/03 OR 01/03/03 etc etc depending on what the user selects.
MonthSql is then added on the end of two sql strings, a select and update. These strings then need to be executed when a command button is clicked.
The problem I’m having is making the MonthSql string global to be available in either a module function, or a command button.
If I debug.print monthsql in a function, or on a command button it isn’t showing the string at all, so I guess other objects cant see the string because its in the afterupdate event of the list box..
Question is, how can I make the string monthsql available to other objects? I don’t want to go down the route of creating a query in the sys table and then executing it etc, id rather use currentdb.execute(selectsql) etc.
Thanks in advance. Elliot.