refresh form, visual controls, not requery

G

Guest

I have a form with a number of controls, several of them are required. I've
colored (Backcolor) the required controls. The colors disappear when the
user enters the control. The color reappears if the user leaves the control
blank. This works perfectly the first time a user opens the form. If the
user closes the form and reenters, these “defaults†reappear. If they hit
the save button, which opens a new record after saving, the “defaults†do not
reappear. I'm trying to duplicate that initial state of the form when the
user hits the save button. This is an important visual reference for the
users.

I’ve tried requery (even though I know that is for data), refresh and
repaint, in various places. I cannot for the life of me think of any command
that resets the form. My last resort is to have the save button close and
reopen the form, but I know there is an easier way.

Thanks for your help.
 
G

Guest

Use the Current event of the form to set the properties of your controls how
you want them. For example, if you want a text box to have a yellow
background:

Me.txtMyTexBox.BackColor = vbYellow

Do that for each control you want to format.
 
G

Guest

I was going that route, but it only solved some of the issues. I have some
tab controls too, that stay on the third tab for example, and should always
start on the first.
 
G

Guest

I don't think I understand your statement, Tedd. Are you saying this is a
tab form and some of the controls are on the 3rd tab and each new record you
want to start on the first tab?
 
G

Guest

I'm sorry I wasn't clear. Most of the controls are on the form itself
separate from the tabs. I have two sets of three tabs in small rectangles
which together take up at most 1/3 of the whole form. The first tab in each
rectangle contains a few required fields (this was necessary for continuity).
The second and third tabs have no required fields.

If the user fills out information on the 2nd or 3rd tab then saves the form,
that tab will be on top when the form gets a new record. If on the other
hand, I close the form and re-open, then all colors and tabs are set
correctly.
 

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