elementary question about forms

  • Thread starter Thread starter clueless2003
  • Start date Start date
C

clueless2003

Guest
This has got to be a simple question, but I am "clueless", so I'll pose it to the group. The first one who answers it gets...my undying gratitude.

A similar question was contained in an earlier posting of mine (sorry if I'm being repetitive). What I want is a "clean" form for the user when the form is initially opened. Currently, I'm getting the first line of data from the table which feeds into the form. My inclination would be to put a blank line in the table, but that doesn't feel right (and Access databases are all about feeling).

Okay, now I'm really done for the night!
 
If you are looking for a NEW record when the form loads then a simple
Code:
DoCmd.GoToRecord , , acNewRec
in the form load event should do but if you just want to hide form data that loads with the form the first time try setting the Detail area of the form property of VISIBLE=NO or in the form load or open event
Code:
me.detail.visible=false
then when a user selects a record from a combo box change the detail.visible property =YES or
Code:
me.detail.visible=true

or
Code:
Private Sub Combo1_AfterUpdate()
    'insert code for naviagating to selected record

    'display the detail area so the record can be seen
    Me.Detail.Visible=True
End Sub
 
Calvin (or whomever),

Where exactly (please be specific) would you recommend I input this code?
 
Listen to Pat, clueless.

When you open a form you can open it in a number of ways: FormAdd, FormEdit, ReadOnly, and FormPropertySettings.

ie.

Code:
DoCmd.OpenForm "frmYourForm", acNormal, , , acFormAdd, acWindowNormal

Using this method will open your form on a brand new record just dying to be populated.
 
This worked really weel for me

Private Sub Form_Load()

DoCmd.GoToRecord , , acNewRec
YourControl.SetFocus

I placed the set focus command in there so the first controll that is entered, is always highlighted. I hope this helps.
 
coryt said:
I placed the set focus command in there so the first control that is entered, is always highlighted.

Why don't you just reorder your tab indexes?
 
Because the focus is set to that combo box only when the form is opened. The user selects the value, then it is carried over every time the user starts a new record. After value is carried over, the focus is set to a text box, where it stays for every new record until the form is closed.

I have no formal Access training, so if there is a beter way of doing it, I am very open to suggestions.

Also, did you see my other post Mile? Check it out and offer any suggestions you can. I am kinda stumped.

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=49510
 

Users who are viewing this thread

Back
Top Bottom