Default blank record when opening form (1 Viewer)

Turbojohn

Registered User.
Local time
Today, 06:49
Joined
Aug 14, 2006
Messages
16
Hi,

I have a form which is based on a table.

I was wondering if it is possible that when the form is opened a blank record could be displayed rather than the first entry in the table. In other words, it would be like opening a form and clicking the "Add Record" button, a blank record would be displayed and data entry could take place.

Any thoughts/ideas would be much appreciated.

Thanks in advance
Turbojohn
 
Turbojohn said:
Hi,

I have a form which is based on a table.

I was wondering if it is possible that when the form is opened a blank record could be displayed rather than the first entry in the table. In other words, it would be like opening a form and clicking the "Add Record" button, a blank record would be displayed and data entry could take place.

Any thoughts/ideas would be much appreciated.

Thanks in advance
Turbojohn

Hey Turbojohn,

Open up your form in design view and go to the forms properties. Go to the second tab (Data) and make sure Data Entry is 'Yes' This should give you what your after.

HTH,
Shane
 
...can we visit this again? This is stumping me...

Rather than having the form open up in edit mode (which does not allow me to view the past records, but merely enter new ones...)

Is there a way to have the form default to add a new record, but still have the olders records available to browse?

Any tips would be appreciated.

Thanks!
 
put this in your code after you open the form. so if u have a button
Code:
Docmd.openform formname
DoCmd.GoToRecord , , acNewRec
 
ahhh... that second line...

so simple, yet so valuable. :)

Thanks!!!
 
Where exactly do I put this code in at please?
Hi. Welcome to AWF!

This is a very old thread, you might consider starting a new one. You can reference this thread if you like. To answer your question, it looks like they added a button to open the form and they placed that code in the Click event of that button.
 
A method I have employed to achieve this is to load a non-existent record.

The record in question is a record with the unique ID of zero "0"....

Create a query based on the table behind the form and in the criteria specifiy that the ID returned should be ID zero "0" ...

Open the text version of the query and copy the text.

Open the form in question and in the forms load event specify that the forms record source should be set to the text version of the query.

Now when you open the form it will show a blank record. You can enter anything into the form and a record will be saved as a new record
 
Here's what worked for me to give me a blank form when the form is first loaded:

Private Sub Form_Load()

Me.Form.RecordSource = "SELECT * FROM [qryProdMaster] WHERE PMSiteID = 0"

End Sub

The key in the above RecordSource is the 'PMSiteID = 0'. I have no ID with 0 so it gives me a blank form. I then have a dropdown on my form that allows me to select the info (the ID) that I need and then requery the form.
 
Here's what worked for me to give me a blank form when the form is first loaded:

Private Sub Form_Load()

Me.Form.RecordSource = "SELECT * FROM [qryProdMaster] WHERE PMSiteID = 0"

End Sub

The key in the above RecordSource is the 'PMSiteID = 0'. I have no ID with 0 so it gives me a blank form. I then have a dropdown on my form that allows me to select the info (the ID) that I need and then requery the form.
Hi. Welcome to AWF!

First, this is an old thread. Second, if you simply "requery" the form, wouldn't you still have a blank record since you haven't change the WHERE condition? I suspect you actually meant you adjust/update the Form's RecordSource property with the new ID, correct? In any case, again, this is an old thread...
 

Users who are viewing this thread

Back
Top Bottom