C
Chris Kersey
Hi,
I'm fairly new to programming in Access, and I'm having some trouble getting
a selected item (string and a long) from FORM B to FORM A.
setup
FORM A contains a bound text box that I placed a button next to labeled
"change". I created a macro behind this button that opens FORM B (which is
pretty much all it does). The reason for the second window is because there
is too much data to present in a drop down, so I created Form B to contain a
text box and a flex grid. As the user types letters into the textbox, the
db table is queried with "select * from foo where foo.bar='" & str & "*'
order by foo.bar". The result set I populate the flex grid and listen for a
doubleclick event from which to select the user's option.
problem
The purpose of the selection is to re-assign an existing association based
on the user's choice made on Form B. I can't seem to pass the required
information from FORM B back to FORM A where I can then update the db.
Things I've tried
1. I tried assiging the information directly back to FORMA.txtBox.value but
got an error "you can't do that unless the control has focus". I tried
setting focus, but even the focus throws an error I think because the form
on which it resides does not have focus.
2. I tried creating a public module contaning a public variable (go
between), but assigning to that, it seems to dissapear into the void.
QUESTION:
Is there a common way of doing this sort of thing in ACCESS? Is there a
parent/child setting?. In VB, I could do #2, or even raise an event to
trigger some global action, but the way ACCESS works is throwing me a curve
ball. Any help would be greatly appreciated.
Code on request.
Chris Kersey
I'm fairly new to programming in Access, and I'm having some trouble getting
a selected item (string and a long) from FORM B to FORM A.
setup
FORM A contains a bound text box that I placed a button next to labeled
"change". I created a macro behind this button that opens FORM B (which is
pretty much all it does). The reason for the second window is because there
is too much data to present in a drop down, so I created Form B to contain a
text box and a flex grid. As the user types letters into the textbox, the
db table is queried with "select * from foo where foo.bar='" & str & "*'
order by foo.bar". The result set I populate the flex grid and listen for a
doubleclick event from which to select the user's option.
problem
The purpose of the selection is to re-assign an existing association based
on the user's choice made on Form B. I can't seem to pass the required
information from FORM B back to FORM A where I can then update the db.
Things I've tried
1. I tried assiging the information directly back to FORMA.txtBox.value but
got an error "you can't do that unless the control has focus". I tried
setting focus, but even the focus throws an error I think because the form
on which it resides does not have focus.
2. I tried creating a public module contaning a public variable (go
between), but assigning to that, it seems to dissapear into the void.
QUESTION:
Is there a common way of doing this sort of thing in ACCESS? Is there a
parent/child setting?. In VB, I could do #2, or even raise an event to
trigger some global action, but the way ACCESS works is throwing me a curve
ball. Any help would be greatly appreciated.
Code on request.
Chris Kersey