Pop up to ask for number

G

Guest

I have a subform that I would like to remove two constant fields from and
have pop up boxes appear instead. What would trigger this would be the
selection of a certain item from a list (for example if someone picks
Software from a combo box I would like a pop up message box appear and ask
for the version number of that software). Is this possible?

Thank you,

Teri.
 
G

Guest

Use the After Update event of the Combo box

If Me.MyCombo = "Software" Then
DoCmd.OpenForm.......
End If
 
G

Guest

Klatuu,

Thank you! I put the command in the After Update Event of the combo box and
tried the form. I got a message back saying "Microsoft Access can't find the
macro 'If Me.'. . . " I will make the attempt at creating this macro on my
own, I think I can do it. If not I will come back.

In the meantime, working with the same combo box and wanting to do basically
the same thing, I need to have a different entry form come up for 4 other
items. I am assuming that I will just need to modify what I have already put
in my After Update, but I am unsure as to how to make this modification to
add what is needed (for example, if CCUSB is chosen I need to be able to add
a number in my SerielNumbers table, if PCC16L is chosen I need to be able to
do the same). How do I tie all of these together so that they make sense to
Access?

Thanks so much!

Teri.
 
K

Keith Wilby

Teri said:
Klatuu,

Thank you! I put the command in the After Update Event of the combo box
and
tried the form. I got a message back saying "Microsoft Access can't find
the
macro 'If Me.'. . . " I will make the attempt at creating this macro on
my
own, I think I can do it. If not I will come back.

You need to put the code in the event module. Select "Event Procedure" from
the After Update combo box, then click on the button with three dots " ... "
and put the code in there.

HTH - Keith.
www.keithwilby.com
 
G

Guest

The problem you had is because Me.MyCombo was only meant as an example. You
need to change MyCombo to the name of your combo box control.

As to having four different values to look for, I would suggest you use the
Select Case statement in the After Update event of the combo box.

Select Case Me.MyCombo

Case Is "Software"
DoCmd.OpenForm....
Case Is "CCUSB"
'Do whatever for CCUSB
Case Is "PCC16L"
'Do whatever for PCC16L
Case Else
'Do whatever for everything else
End Select

Using this technique, you can perform whatever actions are required for the
selection. The Case Else allows you to process for any selection that does
not have a specific Case for it. It will also be easy to add new cases if
you have to add selections to the combo.
 
G

Guest

Good catch, Keith. I didn't think of the possibility the OP put it in the
Properties Dialog text box.
 
G

Guest

"No Probs" my butt! <:) You're working with someone who knows very little
about this Access thing. I have been posting questions and getting help for
a month or more, but I still don't understand any of this relational stuff or
queries, and mostly this VB stuff! But all you guys/gals are GREAT, and us
pions never give enough thanks for all the help you give us!

Now, I am still confused. I have copy and pasted what you gave me Klatuu,
and am trying to fix it so that it is right. I am okay up to the point where
I get to DoCmd.OpenForm. How am I supposed to put the form in there? I get
this funky box:
OpenForm(FormName, [View as AcFormView=acNormal], [FilterName], [Where
Condition], [DataMode as AcFromOpen DataMode=ac Form Property
Settings],[WindowMode as AcWindowMode=AcWindow Normal], OpenArgs])

Can either of you explain what this means?

Thanks so much!!

Teri.
 
K

Keith Wilby

Teri said:
"No Probs" my butt! <:)

Ouch, taken out of context your honour ;-)

Now, I am still confused. I have copy and pasted what you gave me Klatuu,
and am trying to fix it so that it is right. I am okay up to the point
where
I get to DoCmd.OpenForm. How am I supposed to put the form in there? I
get
this funky box:
OpenForm(FormName, [View as AcFormView=acNormal], [FilterName], [Where
Condition], [DataMode as AcFromOpen DataMode=ac Form Property
Settings],[WindowMode as AcWindowMode=AcWindow Normal], OpenArgs])

Can either of you explain what this means?

That's known as "intellisense" and it's there to help you to complete the
line of code. So you type

DoCmd.OpenForm <Space> and the intellisense kicks in. "FormName" should be
highlighted, so you enter your form's name in quotation marks.

DoCmd.OpenForm "frmMyFormName"

If you put a comma after that, it advances the highlighting in the
intellisense to the first available argument of the command which is the
view (normal, datasheet, etc). All arguments are separated by a comma and
not all arguments are mandatory. If you need more, highlight DoCmd.OpenForm
and press F1.

HTH - Keith.
www.keithwilby.com
 
G

Guest

Sorry, I knew what you meant, just messing with you (as my son would say).

So, if I put in DoCmd.OpenForm "Enter Software Versions", that should be
all I need, right? And if I need a different form for the CCUSB, PCC16L, etc
(the form I would need for them is "Enter Seriel Numbers", I do the same
first one, but change the form name and then continue on with:
Case Is "CCUSB"
'Do whatever for CCUSB
Case Is "PCC16L"
'Do whatever for PCC16L
Case Else
'Do whatever for everything else
End Select

End Sub


Again, those of us that need help (pions as I put it earlier) certainly
don't thank you "Gaurdian Angels" enough for the help you give us to get our
jobs done!

Thanks again!

Teri.

Keith Wilby said:
Teri said:
"No Probs" my butt! <:)

Ouch, taken out of context your honour ;-)

Now, I am still confused. I have copy and pasted what you gave me Klatuu,
and am trying to fix it so that it is right. I am okay up to the point
where
I get to DoCmd.OpenForm. How am I supposed to put the form in there? I
get
this funky box:
OpenForm(FormName, [View as AcFormView=acNormal], [FilterName], [Where
Condition], [DataMode as AcFromOpen DataMode=ac Form Property
Settings],[WindowMode as AcWindowMode=AcWindow Normal], OpenArgs])

Can either of you explain what this means?

That's known as "intellisense" and it's there to help you to complete the
line of code. So you type

DoCmd.OpenForm <Space> and the intellisense kicks in. "FormName" should be
highlighted, so you enter your form's name in quotation marks.

DoCmd.OpenForm "frmMyFormName"

If you put a comma after that, it advances the highlighting in the
intellisense to the first available argument of the command which is the
view (normal, datasheet, etc). All arguments are separated by a comma and
not all arguments are mandatory. If you need more, highlight DoCmd.OpenForm
and press F1.

HTH - Keith.
www.keithwilby.com
 
K

Keith Wilby

Teri said:
Sorry, I knew what you meant, just messing with you (as my son would say).

So, if I put in DoCmd.OpenForm "Enter Software Versions", that should be
all I need, right?

If you're happy with the default arguments then yes.
And if I need a different form for the CCUSB, PCC16L, etc
(the form I would need for them is "Enter Seriel Numbers", I do the same
first one, but change the form name and then continue on with:
Case Is "CCUSB"
'Do whatever for CCUSB
Case Is "PCC16L"
'Do whatever for PCC16L
Case Else
'Do whatever for everything else
End Select

End Sub

Looks OK to me, give it a try!

Regards,
Keith.
 
G

Guest

Keith,
It didn't work. Do I need to do something else with my properties for that
combo box to make it work? I will play around with it to see if I can figure
out what I did wrong, but I am not going to hold my breath.

Thanks again for your help!

Teri.
 
K

Keith Wilby

Teri said:
Keith,
It didn't work. Do I need to do something else with my properties for
that
combo box to make it work? I will play around with it to see if I can
figure
out what I did wrong, but I am not going to hold my breath.

Post all of the relevant code and we'll take it from there.
 
G

Guest

Here is what I have, I hope I didn't screw it up. An = wasn't indicated in
any of the previous posts by either you or Klatuu, but the computer wouldn't
let me do anything without it.

Private Sub ProductID_AfterUpdate()
Select Case Me.ProductID

Case Is = "Software"
DoCmd.OpenForm "Enter Software Versions"

Case Is = "CCUSB"
DoCmd.OpenForm "Enter Seriel Numbers"

Case Is = "PCC16L"
DoCmd.OpenForm "Enter Seriel Numbers"

Case Is = "ISOTR"
DoCmd.OpenForm "Enter Seriel Numbers"

Case Is = "Holter Recorder (VX3IA)"
DoCmd.OpenForm "Enter Seriel Numbers"

End Select
 
G

Guest

I'VE DONE IT, I FIGURED IT OUT! Sorry, a little excitement for a minute
there. It wasn't the code itself that was causing the problem. I needed to
change the Product Name to the Product ID (for example I needed to put in 25
instead of Box12Z). Thank you so much for getting me going on the right path
here, both Keith and Klatuu! You are FANTASTIC!!

Thanks so much again!!! Now on to see if someone can set me in the right
direction for another issue!

Teri.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top