Form goes blank if no record in bound query

K

Kiwi_731

Hi Folks

Using Access 2003 on Win XP.

Have form containing a number of buttons which activate various VBA
routines. Form is also bound to a query which returns exactly one record,
once the initial steps have been carried out, but which returns no records
until after the first button has been pressed and some data gathered. The
data in the query is displayed in text boxes in the lower part of the form.
Simple, yes?

Trouble is, in the no-records state, the form appears *totally blank* (no
buttons even!). It's a bit hard to run the initial routine if I can't see the
button to run it with!

I don't pretend to be an old hand at this... can one of you cognoscenti
please assist?

TIA

Hopeful Kiwi
 
K

Kiwi_731

Hi again. Quick update.

To get around the no-records situation I have put some code into the form's
Open event handler to check whether the table is empty and append a record
with some default values if it is. I open the table, use .AddNew, .Fields and
..Update. in a VBA multiline With <tablename> statement. This works, sort of.
That is to say, the first time I open the form, it appears blank, but if I
close it and open it again, everything appears as it should.

How can I avoid this undesirable behaviour?
 

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