Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dropdown false

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Hey,

I have 2 comboboxes. In every new form screen (order input) these are empthy. Important, the second comboboxes kan only be activated if there is a value or a selection made in the first combobox. I tried something but does not 100% the job.

Code:
if (IsNull([combobox1].value) then
Me!combobox2.locked = true (ok)
me!combobox2.dropdown false (not ok, he drop down)

Other options are, make visible, not visible.
Wonder also under with event I should put my code. Now it is under Enter

Good advice welcome !
 
The DropDown method have NO parameter ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi,

The dropdown method does not have any additional parameters. It causes the combo box to display the list of values just as though you had clicked on the down-arrow next to it.

I would put the following code in the AfterUpdate event of comboxbox1:-
Code:
me.combobox2.enabled = not (trim(me.comboxbox1.value & "")="")
to disable it unless some value has been selected.

HTH
pjm
 
ok, I did not know dropdown had no parameters

I fixed it with function Enabled

Just last small question.
If I add a new customer, it is not visible in my combobox.
I tried, requery, docmd.save...

Perhaps I should save my form record ?
 
Hard to say without more details, but if you are adding records to the data set underlying your combobox rowsource then yes, you will need to requery the combobox to see any additions that you have saved:-
Code:
me.combobox1.requery

HTH
pjm
 
me.combobox.requery does not do the job, the new record is added via another form and the combobox is feed with a query taking these data. I tried so many things, but non helped. If you go manually to the previous or next record and return, yes then the combobox is updated.
 
You must commit the new record in the other form before you requery the combobox1 otherwise it doesn't yet exist in the underlying data set!

pjm
 
Yes. A new record will not appear in any query unless it is saved.

pjm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top