Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble with the way my form opens 2

Status
Not open for further replies.

Jimenda

IS-IT--Management
Jun 13, 2001
19
0
0
US
Hi,
When my ACCESS Db is first opened I have it display just my form without a window. My form has 8 combo boxes in which items are selected and then save to a table by clicking a submit button. My problem is that whenever I open my database my form displays as it should, but it already has values in each combo box, these values match the value of the top record (oldest) of the table I'm saving to. How can I get this table to open with no preselected values?

Thank You,

Jimenda
 
Jimenda,

Place the following line of code on the form's open event:

DoCmd.GoToRecord , , acNewRec

This will result in the form opening to a pending new record.

Cheers,
Bill
 
How are ya Jimenda . . . . .

Thats strange . . . When a form opens, if there's no intervening code, it [blue]goes to the first record in the rcordset[/blue] (not the last). So there's two ways this can happen:
[ol][li]Code is sending the focus to the last record. Something like . . .
Code:
[blue]DoCmd.GotoRecord, , acLast[/blue]
[/li]
[li]The [purple]RecordSource[/purple] of the form is based on a query where the [purple]PrimaryKey is sorted decending[/purple].[/li][/ol]

In any case [blue]formerTexan[/blue] has prescribed what you need for resolution . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top