Clear combo box contents on open

  • Thread starter Thread starter jtfalk
  • Start date Start date
J

jtfalk

Good morning,

I have a form that I made that when you fill in the 3 combo boxes it opens
the report and pulls the valuse from these boxes and then closes the form. Is
there something that I can put in the "on open" for that form that clears the
combox values? When I reopen the form the last valuse I had out in there are
still there.

Thanks
 
hi jt,
I have a form that I made that when you fill in the 3 combo boxes it opens
the report and pulls the valuse from these boxes and then closes the form. Is
there something that I can put in the "on open" for that form that clears the
combox values? When I reopen the form the last valuse I had out in there are
still there.
This should do it:

Public Sub Form_Load()

yourComboBoxControl.Value = Null

End Sub


mfG
--> stefan <--
 
Depending on version of Access, I've noticed that some code breaks when the
'dot' is used between "Me" and an object that I created. Once I change that
to the 'bang' ("!"), the code stops failing.

I suspect it has something to do with a stricter, more literal
interpretation of the dot (".") as an indicator of a built-in Method or
Property, while the bang ("!") indicates a user-created object.

JOPO (just one person's opinion)

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
hi Jeff,

Jeff said:
Depending on version of Access, I've noticed that some code breaks when the
'dot' is used between "Me" and an object that I created. Once I change that
to the 'bang' ("!"), the code stops failing.
Especially in the form context I use the following convention:

- Me is only used when referencing form methods or objects, e.g.
Me.Dirty or Me.Parent.
- Me is not used when referencing child controls, txtInputField or
cboSelectValue.
- The bang is only used as Me![fieldName] as field accessor.
I suspect it has something to do with a stricter, more literal
interpretation of the dot (".") as an indicator of a built-in Method or
Property, while the bang ("!") indicates a user-created object.

JOPO (just one person's opinion)
=:)
afaik is the difference, that dot uses normal ("early") binding against
object methods and properties, while bang enumerates collections at runtime.

but, I know this not the whole truth.)


mfG
--> stefan <--
 
Back
Top