On a form I have a list box, whose value is a row source from a query:
SELECT [Legend Query].Field13, Mid$([Field13],6,2) & "/" & Mid$([field13],9.2) & "/" & Mid$([field13],1,4) AS RightDate FROM [Legend Query];
Basically all this is doing is calling a single value from a table (whose value changes weekly), and formatting it to that it can function as a text string in a subsequent procedure that defines a path. That is, the value in this listbox (txtDate) contributes to defining where another command will look for and retrive a report file.
When I open the form, the list box displays correct, i.e a date string. But a command button whose event includes parsing this date string fails...UNLESS I click (manually change to focus to) on the listbox prior to clicking on the command button. I've tried Me.txtDate.SetFocus, and Me.txtDate.Requery, but nothing has worked so far. I'm only using a listbox because I couldn't get a textbox to display the value.
What's the answer?
T.Y.
SELECT [Legend Query].Field13, Mid$([Field13],6,2) & "/" & Mid$([field13],9.2) & "/" & Mid$([field13],1,4) AS RightDate FROM [Legend Query];
Basically all this is doing is calling a single value from a table (whose value changes weekly), and formatting it to that it can function as a text string in a subsequent procedure that defines a path. That is, the value in this listbox (txtDate) contributes to defining where another command will look for and retrive a report file.
When I open the form, the list box displays correct, i.e a date string. But a command button whose event includes parsing this date string fails...UNLESS I click (manually change to focus to) on the listbox prior to clicking on the command button. I've tried Me.txtDate.SetFocus, and Me.txtDate.Requery, but nothing has worked so far. I'm only using a listbox because I couldn't get a textbox to display the value.
What's the answer?
T.Y.