Activate Form

K

Katrina

I have a command button in "start form" that opens a
form "Equip Form". Equip Form has a drop down menu, and I
would like to have the drop down default to the first item
in the list [cntrl.itemdata(0)]

I've tried putting the following lines in the OnLoad,
OnActivate, OnOpen, And OnCurrent Focus Events of "Equip
Form".
Docmd.requery "Cntrl"
cntrl=cntrl.itemdata(0)
None of them seem to work when I open the form through
code in Start Form. I've tried putting
forms("equip").setfocus
in the code for Start Form, but this doesn't work
either....

I'm not sure what to do. I think that the problem might
be that I open the form, and then input the info needed
for the query through the Start Form code (so the code for
activate, load and open do the requery before the info
needed is present). How can I make Start Form code open
Equip Form, enter the data, and then run one of the Equip
Form's Focus Events?

I would like to have the code to requery be in the Equip
Form Focus Events, because I have more than one Form that
I open from Start Form using this same command, and I need
to requery different fields based on the form I open.

Hopefully I have explained this well enough that someone
can help.

Thanks in advance,
Katrina
 
J

James Bertino

Katrina,
Try this in your OnOpen event
Forms!FormName!DropDownName.DefaultValue = """WhatEverTheFirstIs"""
If you wanted you could reference a variable with the first selection value
but this easier.
Jay
 

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

Top