Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-15-2017, 01:50 AM   #1
navi95
Newly Registered User
 
Join Date: Jan 2013
Posts: 59
Thanks: 34
Thanked 0 Times in 0 Posts
navi95 is on a distinguished road
Question Opening Specific Record from a List

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 is offline   Reply With Quote
Old 03-15-2017, 01:55 AM   #2
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,432
Thanks: 165
Thanked 1,737 Times in 1,706 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: Opening Specific Record from a List

I would have a read here for a sensible solution http://baldyweb.com/wherecondition.htm
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
The Following User Says Thank You to Minty For This Useful Post:
navi95 (03-15-2017)
Old 03-15-2017, 01:57 AM   #3
navi95
Newly Registered User
 
Join Date: Jan 2013
Posts: 59
Thanks: 34
Thanked 0 Times in 0 Posts
navi95 is on a distinguished road
Re: Opening Specific Record from a List

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 is offline   Reply With Quote
Old 03-15-2017, 02:31 AM   #4
navi95
Newly Registered User
 
Join Date: Jan 2013
Posts: 59
Thanks: 34
Thanked 0 Times in 0 Posts
navi95 is on a distinguished road
Re: Opening Specific Record from a List

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`?
navi95 is offline   Reply With Quote
Old 03-15-2017, 03:18 AM   #5
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,432
Thanks: 165
Thanked 1,737 Times in 1,706 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: Opening Specific Record from a List

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.
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 03-15-2017, 03:43 AM   #6
navi95
Newly Registered User
 
Join Date: Jan 2013
Posts: 59
Thanks: 34
Thanked 0 Times in 0 Posts
navi95 is on a distinguished road
Re: Opening Specific Record from a List

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 is offline   Reply With Quote
Old 03-15-2017, 05:01 AM   #7
navi95
Newly Registered User
 
Join Date: Jan 2013
Posts: 59
Thanks: 34
Thanked 0 Times in 0 Posts
navi95 is on a distinguished road
Re: Opening Specific Record from a List

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

navi95 is offline   Reply With Quote
Old 03-15-2017, 05:39 AM   #8
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,432
Thanks: 165
Thanked 1,737 Times in 1,706 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: Opening Specific Record from a List

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.
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 03-15-2017, 05:41 AM   #9
navi95
Newly Registered User
 
Join Date: Jan 2013
Posts: 59
Thanks: 34
Thanked 0 Times in 0 Posts
navi95 is on a distinguished road
Re: Opening Specific Record from a List

I might checkout the wherecondition another time

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

Thanks

navi95 is offline   Reply With Quote
Reply

Tags
button , form , query , tempvars

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening specific form record from datasheet hyperlink for (New) Record ry-mac Forms 1 01-14-2017 01:37 PM
Jump to specific record on opening RichStone Forms 5 03-11-2016 02:52 PM
Opening report to specific record RyLane Forms 12 02-13-2014 11:32 AM
Opening a form for a specific record rickdave Forms 0 11-29-2011 02:11 AM
opening a specific record woknick General 1 12-10-2006 08:29 PM




All times are GMT -8. The time now is 12:49 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World