Opening Specific Record from a List (1 Viewer)

navi95

Registered User.
Local time
Today, 15:30
Joined
Jan 3, 2013
Messages
59
Hi all!

Im back with another question!
Heres the basic outline:

I have created a booking application in Access and on my switchboard I have a subform which is based on a query which lists all my current bookings and has the following fields: Booking Nr, Customer ID, Name, Apartment etc.

Now...I would like to create a Button (which will appear in each line/record in the subform) once pressed, which will open up that record in a form so that I can make changes if needs be.

I was thinking along the lines of that the Button would make a TempVars? Using that, I can make the Form i want for editing to open based on the Tempvars value.

I hope you guys understand what I mean, if not, let me know and Ill make some screenshots to help illustrate what I mean.

Thanks!

Nav
 

navi95

Registered User.
Local time
Today, 15:30
Joined
Jan 3, 2013
Messages
59
That looks like exactly what I need!
I will have a play later on and let you guys know how I get on...thanks for the quick reply!
 

navi95

Registered User.
Local time
Today, 15:30
Joined
Jan 3, 2013
Messages
59
I tried giving it a go...nothing came up. Not even an error asking to debug, which I was expecting since I wasnt sure if I had written the code correctly.

I even tried a simple 'docmd.openform "form_edit_booking" ' to see if the button works at all...that also didnt work. Ive checked other buttons on other forms, it seems fine, not sure why its not working on this subform though.

any thoughts`?
 

Minty

AWF VIP
Local time
Today, 22:30
Joined
Jul 26, 2013
Messages
10,355
Can you post up your exact code ?

Be aware that prefixing your forms with form_ is a not a good idea as access uses that naming structure internally for objects.
 

navi95

Registered User.
Local time
Today, 15:30
Joined
Jan 3, 2013
Messages
59
Right, I have now got the button to at least open the form. I had to change Properties of the subform to allow edits, otherwise the button refused to work.

Now I will try the where condition out.
 

navi95

Registered User.
Local time
Today, 15:30
Joined
Jan 3, 2013
Messages
59
Right, after figuring out why the Button wouldnt work, i had to change some of the properties of the subform, I actually went with the Tempvars solution.

So the button will create a tempvars called "bknr" and then opens the form using the tempvars as the default value for the booking number (form is based on a query)

Thanks for previous comments :)
 

Minty

AWF VIP
Local time
Today, 22:30
Joined
Jul 26, 2013
Messages
10,355
Glad you've sorted it out. Make sure you reset any tempvar's you might refer to anywhere else. I'm personally not a huge fan, and prefer to set variables per form to avoid forgetting where they are set and unset.
 

navi95

Registered User.
Local time
Today, 15:30
Joined
Jan 3, 2013
Messages
59
I might checkout the wherecondition another time :)

Im happy its working, makes my life that little bit easier now in the database!

Thanks :)
 

Users who are viewing this thread

Top Bottom