J
Jack Isaacs
Hello All
I need an OnOpen event for a form that will carry out one of 5 actions -
depending on a selection made by the user.
i.e.
The user should first be presented with a messagebox along the lines of
"Enter X to do action1, or enter Y to do action2 or enter Z to do action3"
Then
if the user enters "X" the OnOpen event must do action1 (which would be to
set the value of txtName to "Bricks and bats" and then open rpt1)
if the user enters "Y" the OnOpen event must do action2 (which would be to
set the value of txtName to "Trains, Boats and Rockets" then open rpt2)
if the user enters "Z" the OnOpen event must do action3 (which would be to
set the value of txtName to "People and Places" then open rpt3)
if the user enters "V" the OnOpen event must do action3 (which would be to
set the value of txtName to "Let's start here" then open rpt4)
if the user enters "W" the OnOpen event must do action3 (which would be to
set the value of txtName to "My house" then open rpt5)
if the user enters anything else the OnOpen event must do nothing further.
(in fact each of the actions will have 2 or 3 more commands in them)
I know I could do this by getting the user to click one of 5 buttons on the
form, but I would much rather 'force' the user select the action as the form
opens - and also I would prefer not to have to display any further buttons,
textboxes etc on this particular form.
I was hoping to use a MsgBox command for this followed by a Case statement,
but I don't think the MsgBox command allows the user to input a parameter.
If anyone can suggest how this could be done I would be very grateful.
Many thanks
Leslie Isaacs
I need an OnOpen event for a form that will carry out one of 5 actions -
depending on a selection made by the user.
i.e.
The user should first be presented with a messagebox along the lines of
"Enter X to do action1, or enter Y to do action2 or enter Z to do action3"
Then
if the user enters "X" the OnOpen event must do action1 (which would be to
set the value of txtName to "Bricks and bats" and then open rpt1)
if the user enters "Y" the OnOpen event must do action2 (which would be to
set the value of txtName to "Trains, Boats and Rockets" then open rpt2)
if the user enters "Z" the OnOpen event must do action3 (which would be to
set the value of txtName to "People and Places" then open rpt3)
if the user enters "V" the OnOpen event must do action3 (which would be to
set the value of txtName to "Let's start here" then open rpt4)
if the user enters "W" the OnOpen event must do action3 (which would be to
set the value of txtName to "My house" then open rpt5)
if the user enters anything else the OnOpen event must do nothing further.
(in fact each of the actions will have 2 or 3 more commands in them)
I know I could do this by getting the user to click one of 5 buttons on the
form, but I would much rather 'force' the user select the action as the form
opens - and also I would prefer not to have to display any further buttons,
textboxes etc on this particular form.
I was hoping to use a MsgBox command for this followed by a Case statement,
but I don't think the MsgBox command allows the user to input a parameter.
If anyone can suggest how this could be done I would be very grateful.
Many thanks
Leslie Isaacs