View all records but start with blank record

  • Thread starter DJ Notion via AccessMonster.com
  • Start date
D

DJ Notion via AccessMonster.com

Hello.

I have a Sales Leads form that users will be entering new leads into. RIght
now I have data entry set to yes so when they open it they get a new record.
I would still like them to be able to view all other records though.

Any help is appreciated. Thanks.
 
N

NKTower

Let me assume that your tbl_LEADS has a LeadID - perhaps an auto-number.
Set Data Entry = False
Set Allow Additions = TRUE

Method 1:
Change the recodr source for the form to something like this:

SELECT * FROM [tbl_LEADS] WHERE ( [Lead_ID] = -1 )

Now that's an impossible situation, so you won't get any existing records,
but you WILL get the 'new record' offered to you.

Then a "Show All" button changes the record source

Private Sub cmd_ShowAll_Click()
Me.RecordSource = "SELECT * FROM [tbl_LEADS]"
End Sub


Method 2:
Set the FILTER property to [LeadID] = -1
or some other impossible situation. You will still get the new record
offered.
If the user clears the FILTER button in the FORM VIEW button bar, the user
should get all records.

Of the two, I think I like the first as you can embellish the selection with
ORDER BY, a WHERE statement that restricts to various conditions such as
territory etc.
 
K

Klatuu

Set data entry to No and Allow Additions to Yes
You may be tempted to go to a new record when the form opens, but don't.
Doing that repeatedly will contribute to database bloat.
 
D

DJ Notion via AccessMonster.com

Thanks for the help. I have found an easier way without having to have the
user click on a button.
Let me assume that your tbl_LEADS has a LeadID - perhaps an auto-number.
Set Data Entry = False
Set Allow Additions = TRUE

Method 1:
Change the recodr source for the form to something like this:

SELECT * FROM [tbl_LEADS] WHERE ( [Lead_ID] = -1 )

Now that's an impossible situation, so you won't get any existing records,
but you WILL get the 'new record' offered to you.

Then a "Show All" button changes the record source

Private Sub cmd_ShowAll_Click()
Me.RecordSource = "SELECT * FROM [tbl_LEADS]"
End Sub

Method 2:
Set the FILTER property to [LeadID] = -1
or some other impossible situation. You will still get the new record
offered.
If the user clears the FILTER button in the FORM VIEW button bar, the user
should get all records.

Of the two, I think I like the first as you can embellish the selection with
ORDER BY, a WHERE statement that restricts to various conditions such as
territory etc.
 
D

DJ Notion via AccessMonster.com

Thanks for the help. I have found an easier way without having to have the
user click on a button.
Let me assume that your tbl_LEADS has a LeadID - perhaps an auto-number.
Set Data Entry = False
Set Allow Additions = TRUE

Method 1:
Change the recodr source for the form to something like this:

SELECT * FROM [tbl_LEADS] WHERE ( [Lead_ID] = -1 )

Now that's an impossible situation, so you won't get any existing records,
but you WILL get the 'new record' offered to you.

Then a "Show All" button changes the record source

Private Sub cmd_ShowAll_Click()
Me.RecordSource = "SELECT * FROM [tbl_LEADS]"
End Sub

Method 2:
Set the FILTER property to [LeadID] = -1
or some other impossible situation. You will still get the new record
offered.
If the user clears the FILTER button in the FORM VIEW button bar, the user
should get all records.

Of the two, I think I like the first as you can embellish the selection with
ORDER BY, a WHERE statement that restricts to various conditions such as
territory etc.
 
D

DJ Notion via AccessMonster.com

Through my testing I have found that as long as no data is entered in the
original new record being created, that a second new record is never created.
So it is working exactly how I wanted it to. Thanks for the advice.
Set data entry to No and Allow Additions to Yes
You may be tempted to go to a new record when the form opens, but don't.
Doing that repeatedly will contribute to database bloat.
[quoted text clipped - 3 lines]
Any help is appreciated. Thanks.
 
T

tbl

Set data entry to No and Allow Additions to Yes
You may be tempted to go to a new record when the form opens, but don't.
Doing that repeatedly will contribute to database bloat.


Do you mean it will bloat because of new, mostly blank
records? Or something else?
 

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