Start out with blank fields in listboxes

R

Repent34

I have a form with 2 listbox controls. Both are bound to tables to display
their data. In both tables, there is a blank field at the beginning and
when I run the form, and select the listboxes, the first entry there is
blank.

I want that when a new record is created, via the form, that the listboxes
start out blank, not with the last value shown in them.

how can I do this?

chris
 
A

Al Campagna

Repent34,
Not sure why you have the blank record come up as a choice in a listbox,
and why the table itself would have a blank record, but...

If a new record always shows the last listbox value entered, then you
either have a DefaultValue problem with the listbox...
OR
The listboxes are not bound to any field in the table. (ControlSource =
[SomeTableField])
"ABC" in the listbox of one record shows "ABC" on all records.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
R

Repent34

the listboxes are both bound to their fields in the table. the default
value for both is blank. what do I put in there?

chris


Al Campagna said:
Repent34,
Not sure why you have the blank record come up as a choice in a
listbox, and why the table itself would have a blank record, but...

If a new record always shows the last listbox value entered, then you
either have a DefaultValue problem with the listbox...
OR
The listboxes are not bound to any field in the table. (ControlSource
= [SomeTableField])
"ABC" in the listbox of one record shows "ABC" on all records.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Repent34 said:
I have a form with 2 listbox controls. Both are bound to tables to
display their data. In both tables, there is a blank field at the
beginning and when I run the form, and select the listboxes, the first
entry there is blank.

I want that when a new record is created, via the form, that the
listboxes start out blank, not with the last value shown in them.

how can I do this?

chris
 
R

Repent34

Well I changed the listboxes to combo boxes, set the control source, left
the default value blank and now when I create a new record the combo boxes
are blank, like I want. Is this the difference between the two styles of
boxes? I also removed the blank field from the linked table.

so far so good.



Al Campagna said:
Repent34,
Not sure why you have the blank record come up as a choice in a
listbox, and why the table itself would have a blank record, but...

If a new record always shows the last listbox value entered, then you
either have a DefaultValue problem with the listbox...
OR
The listboxes are not bound to any field in the table. (ControlSource
= [SomeTableField])
"ABC" in the listbox of one record shows "ABC" on all records.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Repent34 said:
I have a form with 2 listbox controls. Both are bound to tables to
display their data. In both tables, there is a blank field at the
beginning and when I run the form, and select the listboxes, the first
entry there is blank.

I want that when a new record is created, via the form, that the
listboxes start out blank, not with the last value shown in them.

how can I do this?

chris
 
A

Al Campagna

Repent,
I think it was the Default Value. A bound combo or listbox should
always come up as "nothing" on a new record... given that there's no
DefaultValue stipulated, or there is no code to effect the value.
Sound like you're all set...

Note: Keep an eye on your table. If new Blank records show up later,
you may be populating a blank record from a New record. Some value may be
getting set on New Record. A value... that Escaping, or leaving a new
record without any entry does not clear.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Repent34 said:
Well I changed the listboxes to combo boxes, set the control source, left
the default value blank and now when I create a new record the combo boxes
are blank, like I want. Is this the difference between the two styles of
boxes? I also removed the blank field from the linked table.

so far so good.



Al Campagna said:
Repent34,
Not sure why you have the blank record come up as a choice in a
listbox, and why the table itself would have a blank record, but...

If a new record always shows the last listbox value entered, then you
either have a DefaultValue problem with the listbox...
OR
The listboxes are not bound to any field in the table. (ControlSource
= [SomeTableField])
"ABC" in the listbox of one record shows "ABC" on all records.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

Repent34 said:
I have a form with 2 listbox controls. Both are bound to tables to
display their data. In both tables, there is a blank field at the
beginning and when I run the form, and select the listboxes, the first
entry there is blank.

I want that when a new record is created, via the form, that the
listboxes start out blank, not with the last value shown in them.

how can I do this?

chris
 

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