Output the last record entered in the database using Bound Forms

ismith

Registered User.
Local time
Today, 03:57
Joined
Dec 14, 2011
Messages
30
Hi,


Ive got a bound form which has the following info.


These are all in a table called 'tblProduct'


ProductID
Description
Category
Size
Quantity
Price


Now when i use the bound form it shows the first record in the database.
What i want to do is whenever the form is opened it goes to the last ProductID record that has been entered into the database. so it is always the last one that is showing.


Can this be done using bound forms?


If not how else can i get this done?


Thanks...
 
Open the form and :
Code:
forms![COLOR=Red]FormName[/COLOR].recordset.findfirst "[COLOR=Red]ID [/COLOR]= " & DMax("[COLOR=Red]ID[/COLOR]", "[COLOR=Red]TableName[/COLOR]")
Change the red bits.
 
Thanks for that. Ive got that working.

On another form what i want to do is show the next Number in the ProductID that a product will be entered on.

So the last ID in my form is 82 which has spanner. example..

So when a user goes to add another product,
Ive got a bound ProductID box which i want to display 83 because thats were the next item will be added.

How could i do this?
 
Thanks for that. Ive got that working.

On another form what i want to do is show the next Number in the ProductID that a product will be entered on.

So the last ID in my form is 82 which has spanner. example..

So when a user goes to add another product,
Ive got a bound ProductID box which i want to display 83 because thats were the next item will be added.

How could i do this?
Good to hear!

I can see that you're new here so you don't know the forum's protocols :)

You need to create a new thread for every new question.
 

Users who are viewing this thread

Back
Top Bottom