J
Jeanette Cunningham
strCriteria is the normal sort of thing to use with DCount. vba help on
DCount explains it very well.
In your case, strCriteria will be determined by the table or query field
you want to look for matches in, and what is already in the form's
recordsource or is passed as Open Args.
Jeanette Cunningham
DCount explains it very well.
In your case, strCriteria will be determined by the table or query field
you want to look for matches in, and what is already in the form's
recordsource or is passed as Open Args.
Jeanette Cunningham
Bill said:And "strCriteria"?
Jeanette Cunningham said:Bill,
coming at this from a completely different angle, assuming a solution
that does not try to fix what you currently have going wrong, but looks
for something that does work.
I routinely use code like this in form load events to set up a combo
I am using a saved query to check if the value I want to display in the
combo is in the currently set (by code) row source for the combo.
note: TrID is the bound column of the combo
lngTrID is a variable passed in with Open Args
If DCount("[TrID]", "qChkChosenTrack", strCriteria) > 0 Then
'yes chosen track is in the combo's list
Me.cboTrID = lngTrID
Else
'drop down the track combo
Me.cboTrID.SetFocus
Me.cboTrID.Dropdown
End If
Jeanette Cunningham
Bill said:The box stays correctly positioned, but the expanded
portion is disjointed from the combo itself. As a stretch,
I wondered if the positioning coordinates got messed up
and might show up if I captured them in a Debug.Print.
Nothing seems disturbed:
(Form_Load) Before DropDown
Left: 11100
Right: 960
Width: 1800
Height: 300
(Form_Load) After DropDown
Left: 11100
Right: 960
Width: 1800
Height: 300
Bill
Sorry it didn't work. I seem to halfway remember something like that
happening a long time ago, but it has been a long week.
Does the form seem to jump?
Try making sure that no buttons or extra menus are viewable when you
save the form out of design mode. I have seen button menus open at
design time but NOT requested a run time cause the form to jump up and
that could be happening here since the box is appearing below where it
should be.
Good luck.
Ron