New Record

N

Nat

I'm trying to program a texbox to display the number of
the record in stead of using navigation. Is there anyway
I can do that.

Thank you,
Nat
 
A

Al Campagna

Nat,
Here's some "homegrown" code I use on all my forms. It works well.
In an "unbound" text control, use this RecordSource... (use your own
names)

=[CurrentRecord] & " of " & Count([YourKeyField]) & " of " &
DCount("YourKeyField","tblYourTable")

If I had 250 records total, and I was on the first record this would
display as 1 of 250 of 250. As you navigate up in records, 2 of 250 of
250, 3 of 250 of 250, etc...
Let's say we have 10 "Smiths" in our records, and I filter the recordset
accordingly.
Now it will display 1 of 10 of 250. Not only does this tell you what
record you're on, and how many records you have, but can be used to
determine if filtering is in effect.
 
N

Nat

Thank you very much. But, how can I save the maximum
value and plus 1 in order to make a new record as an
autonumber.

For example: If I have 250 records total and I click on
my ADD button then I want it shows 251 as a new record.

Thank you again,
Nat
-----Original Message-----
Nat,
Here's some "homegrown" code I use on all my forms. It works well.
In an "unbound" text control, use this RecordSource... (use your own
names)

=[CurrentRecord] & " of " & Count([YourKeyField]) & " of " &
DCount("YourKeyField","tblYourTable")

If I had 250 records total, and I was on the first record this would
display as 1 of 250 of 250. As you navigate up in records, 2 of 250 of
250, 3 of 250 of 250, etc...
Let's say we have 10 "Smiths" in our records, and I filter the recordset
accordingly.
Now it will display 1 of 10 of 250. Not only does this tell you what
record you're on, and how many records you have, but can be used to
determine if filtering is in effect.
--
HTH
Al Campagna
Candia Computer Consulting
Candia, NH

Nat said:
I'm trying to program a texbox to display the number of
the record in stead of using navigation. Is there anyway
I can do that.

Thank you,
Nat


.
 
N

Nat

Here is some more info on my code:

Private Sub cmdClearData_Click()
Call ClearData
txtEmployeeID.SetFocus

txtEmployeeID.Value = nat.Value + 1

End Sub

This code seem work very well, but I will need to exit
the form and the come back if I need to add a new record.
Meaning that nat.value still store the old value of all
the record. Is there anyway I can fix it so that I don't
have to exit and come back again. ( I did try on Refresh
command, but it doesn't help)

Thank you,
Nat
-----Original Message-----
Nat,
Here's some "homegrown" code I use on all my forms. It works well.
In an "unbound" text control, use this RecordSource... (use your own
names)

=[CurrentRecord] & " of " & Count([YourKeyField]) & " of " &
DCount("YourKeyField","tblYourTable")

If I had 250 records total, and I was on the first record this would
display as 1 of 250 of 250. As you navigate up in records, 2 of 250 of
250, 3 of 250 of 250, etc...
Let's say we have 10 "Smiths" in our records, and I filter the recordset
accordingly.
Now it will display 1 of 10 of 250. Not only does this tell you what
record you're on, and how many records you have, but can be used to
determine if filtering is in effect.
--
HTH
Al Campagna
Candia Computer Consulting
Candia, NH

Nat said:
I'm trying to program a texbox to display the number of
the record in stead of using navigation. Is there anyway
I can do that.

Thank you,
Nat


.
 
A

Al Campagna

Nat,
I use the DMax function. I would set the Default property of EmployeeID
to...
=DMax("[EmployeeID"], "MyTable") + 1
Everytime you open a New record, the value will auto-enter.

--
HTH...
Al Campagna
Candia Computer Consulting
Candia, NH

Nat said:
Here is some more info on my code:

Private Sub cmdClearData_Click()
Call ClearData
txtEmployeeID.SetFocus

txtEmployeeID.Value = nat.Value + 1

End Sub

This code seem work very well, but I will need to exit
the form and the come back if I need to add a new record.
Meaning that nat.value still store the old value of all
the record. Is there anyway I can fix it so that I don't
have to exit and come back again. ( I did try on Refresh
command, but it doesn't help)

Thank you,
Nat
-----Original Message-----
Nat,
Here's some "homegrown" code I use on all my forms. It works well.
In an "unbound" text control, use this RecordSource... (use your own
names)

=[CurrentRecord] & " of " & Count([YourKeyField]) & " of " &
DCount("YourKeyField","tblYourTable")

If I had 250 records total, and I was on the first record this would
display as 1 of 250 of 250. As you navigate up in records, 2 of 250 of
250, 3 of 250 of 250, etc...
Let's say we have 10 "Smiths" in our records, and I filter the recordset
accordingly.
Now it will display 1 of 10 of 250. Not only does this tell you what
record you're on, and how many records you have, but can be used to
determine if filtering is in effect.
--
HTH
Al Campagna
Candia Computer Consulting
Candia, NH

Nat said:
I'm trying to program a texbox to display the number of
the record in stead of using navigation. Is there anyway
I can do that.

Thank you,
Nat


.
 

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