Using Option group selection to call pop up form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating an equipment inventory database. As part of the info that i
need to track, I have 3 types of lease agreements for printer devices. I
would like to create my new record data entry form so that the based on the
lease type selected by the user, only the appropriate finance field are
available. The method I have been trying to make work, is to create an Option
Group with the three lease types as the selectable options. I then attempt to
call an OnExit event that gets the value from the control source of the
option group (LeaseType Field) and based on the value, call the appropriate
pop-up form. Programming is a definate weakness for me and i think it's the
"if Then" statements that are tripping me up. any advice, or better method?
Thanks
 
since you didn't post your code, we can't help you trouble-shoot it. you
should be able to use an If statement okay, but with option groups, i
personally prefer to use a Select statement, usually on the option group's
AfterUpdate event, as

Select Case Me!OptionGroupName
Case 1
DoCmd.OpenForm "MyFirstFormName"
Case 2
DoCmd.OpenForm "MyNextFormName"
Case 3
DoCmd.OpenForm "MyLastFormName"
End Select

the above code assumes that the option buttons have a value of 1, 2, and 3.
if another set of values is being used, adjust the code accordingly. take a
look at the Select Case topic in Help to get a better understanding of how
it works.

hth
 

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

Back
Top