J
jon
I am trying to obtain the status of a sales order, and store that status in
a global variable.
There is only ever 1 record that is returned from my SQL statement which
obtains the status, but how do I put the result into the global variable ?
I can amend the SQL to put the result in a table, but that just pretty much
puts me in the same position.
The only thing I can think of, is to open a form with the results of my SQL,
and set the variable to the value of the linked text box on the form, then
close the form, but this would be very messy, and I'm sure its not the
correct way to do it.
Heres a rough example of what I want to do
Global ORDER_STATUS as string
Public Function Get_sales_order_status() as string
ORDER_STATUS = Docmd.RunSql "SELECT ORDER_HEADER.STATUS FROM CS3TEST_OPHEADM
WHERE (((CS3TEST_OPHEADM.ORDER_NO)=SEL_ORDER_NO()));"
End Function
I know this is obviously wrong, but I thought it may help with my
explination of the problem.
thanks for your help.
Jon
a global variable.
There is only ever 1 record that is returned from my SQL statement which
obtains the status, but how do I put the result into the global variable ?
I can amend the SQL to put the result in a table, but that just pretty much
puts me in the same position.
The only thing I can think of, is to open a form with the results of my SQL,
and set the variable to the value of the linked text box on the form, then
close the form, but this would be very messy, and I'm sure its not the
correct way to do it.
Heres a rough example of what I want to do
Global ORDER_STATUS as string
Public Function Get_sales_order_status() as string
ORDER_STATUS = Docmd.RunSql "SELECT ORDER_HEADER.STATUS FROM CS3TEST_OPHEADM
WHERE (((CS3TEST_OPHEADM.ORDER_NO)=SEL_ORDER_NO()));"
End Function
I know this is obviously wrong, but I thought it may help with my
explination of the problem.
thanks for your help.
Jon