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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add New Record at Top of Continuous Form

Status
Not open for further replies.

Elysynn

Technical User
Mar 18, 2004
82
US
Hi There,

I am creating a tracking form where users can enter and view updates in a subform. I am wondering if it is possible when they click the button to add a new update record if the fields could appear at the top of the continuous form rather than the bottom... If it's simply not possible - I'll go cry in my corner for a while then tell my users to deal with it... ;)

TIA,
Elysynn
 
You could set the form to DataEntry
[tt]Me.DataEntry = True[/tt]
When an Add record button is clicked and set it back in the After Insert event. Alternatively, here is a rather odd idea. Create a row of controls in the header of your continuous form to match the controls in the detail. Set the visible property to 'No' and the Tag to some text, I have use "DE" to test. Set the Allow Additions property to No. Add this code to a command button:
Code:
Me.AllowAdditions = True
For Each ctl In Me.Controls
    If ctl.Tag = "DE" Then
        ctl.Visible = True
    End If
Next
DoCmd.GoToRecord , , acNewRec
DoCmd.GoToControl "txtTextBoxInHeader"
This can be reversed with a button or in the After Insert event.
 
You could set the form to DataEntry
Me.DataEntry = True

How very clever... simple, yet does the trick! :)

Thanks!
Elysynn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top