Open Last Added Record OR Specified Record? (1 Viewer)

phn

Registered User.
Local time
Today, 21:37
Joined
Mar 17, 2006
Messages
21
Hello,

I have created a booking system for loaning of camera kits.

I have created an Add Form which lets you add all of the information of the booking, I have also utilised a command button which opens up another form with the option to print a report based on the current record.

However, when I click on the command button to open up the other form, the record just added is not displayed, the first record in the table is shown..

So basically, is there a way to open up the form to the LAST record in the table, OR the specified record in the add form?

I'm sure there is a simple solution to this,

Thanks,

Dave
 

KenHigg

Registered User
Local time
Today, 16:37
Joined
Jun 9, 2004
Messages
13,327
Sounds like you may a have requery command executing against the primary form. This would save the current record, and display the first record. Think this may be the case?
 

phn

Registered User.
Local time
Today, 21:37
Joined
Mar 17, 2006
Messages
21
i dont think so.

maybe i should explain a little better.

form1 = add booking
form2 = print booking

the record added in form one must be opened up automatically on form2 when a button is clicked.

I have searched these forums, viewed ALL of the relative threads, and I can not find a solution that works.

I tried:

Forms!form2!ID.SetFocus
DoCmd.FindRecord Forms!form1!ID

it doesnt work, just displays an error saying it cannot find the form "form1" in macro or vb code, even though it is present...

please help
 

KenHigg

Registered User
Local time
Today, 16:37
Joined
Jun 9, 2004
Messages
13,327
Can you simply print the booking off the main form?
 

phn

Registered User.
Local time
Today, 21:37
Joined
Mar 17, 2006
Messages
21
I managed to do what I wanted to do, simply by adding acLast to the On Open event of the form.

I would have liked to have been able to print the booking from the current form, but I cannot seem to do it as it prints a report of only the current record, and if I attempt to print from the add form it comes out blank, possible because it is a data entry form for adding records and the record is not stored in the database? im not sure!

any advice would be appreciated! :)

Thanks for the help ;D
 

KenHigg

Registered User
Local time
Today, 16:37
Joined
Jun 9, 2004
Messages
13,327
I'm guessing you need to save the current record in the add form before you try to print it.
 

phn

Registered User.
Local time
Today, 21:37
Joined
Mar 17, 2006
Messages
21
right you are, such a simple thing and yet i couldnt work it out.. im a noob at access!

thanks for your speedy help, much appreciated!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:37
Joined
Feb 19, 2002
Messages
43,408
It's good that you are now doing it the correct way. Using acLast will be unreliable at best in a multi-user environment.
 

Users who are viewing this thread

Top Bottom