By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

Open form based on field entry

P: n/a
Hello all. I think my request is a simple one; however, I am unable to
figure it out by myself.

I need a form (frmCargoEntry) to open whenever the cargo dept is chosen
on another field. So when DeptId is equal to 1 then fromCargoEntry
should open on top of the current form for data entry. Can someone
help me with the correct phrasing? My main form is frmNewJobs.

Thanks. Karen

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Normally, I would do this sort of thing in the AfterUpdate of the combo box
(or whatever control you're using). However, if you do this in that event,
if the user accidentally picks DeptId of 1 then the form would open
immediately, not giving them a chance to make the correct selection. So, I
would probably do this in the Exit event of the combo box.

If Me.cboDeptId = 1 Then
DoCmd.OpenForm "frmCargoEntry",,,,,acDialog
End If

Add more arguments to the OpenForm call, as needed.

--
Wayne Morgan
MS Access MVP
"Rosy" <kr****@portlite.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hello all. I think my request is a simple one; however, I am unable to
figure it out by myself.

I need a form (frmCargoEntry) to open whenever the cargo dept is chosen
on another field. So when DeptId is equal to 1 then fromCargoEntry
should open on top of the current form for data entry. Can someone
help me with the correct phrasing? My main form is frmNewJobs.

Thanks. Karen

Nov 13 '05 #2

P: n/a
Wayne Morgan wrote:
Normally, I would do this sort of thing in the AfterUpdate of the combo box
(or whatever control you're using). However, if you do this in that event,
if the user accidentally picks DeptId of 1 then the form would open
immediately, not giving them a chance to make the correct selection. So, I
would probably do this in the Exit event of the combo box.

If Me.cboDeptId = 1 Then
DoCmd.OpenForm "frmCargoEntry",,,,,acDialog
End If

Add more arguments to the OpenForm call, as needed.


Any reason to not use the Click event?

And, further, if the form containing this DeptID control is based on a
table and as such susceptible to navigation, you' have to teach the
form's Current event to call this Exit or Click procedure as well.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #3

P: n/a
I wouldn't use the Click event for the same reason I wouldn't use the
AfterUpdate event. You are correct, I would limit the popup form to a single
entry to prevent problems.

--
Wayne Morgan
MS Access MVP
"Bas Cost Budde" <b.*********@heuvelqop.nl> wrote in message
news:d9**********@localhost.localdomain...
Wayne Morgan wrote:
Normally, I would do this sort of thing in the AfterUpdate of the combo
box (or whatever control you're using). However, if you do this in that
event, if the user accidentally picks DeptId of 1 then the form would
open immediately, not giving them a chance to make the correct selection.
So, I would probably do this in the Exit event of the combo box.

If Me.cboDeptId = 1 Then
DoCmd.OpenForm "frmCargoEntry",,,,,acDialog
End If

Add more arguments to the OpenForm call, as needed.


Any reason to not use the Click event?

And, further, if the form containing this DeptID control is based on a
table and as such susceptible to navigation, you' have to teach the form's
Current event to call this Exit or Click procedure as well.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.