Control button linked to specific record in a continuous form

ladytriker

New member
Local time
Today, 08:03
Joined
Apr 3, 2014
Messages
8
Access 2010. I have a form pulling from a query to create a "To Do' list of sorts. On this form is a button to open an input form for the corresponding record (I hope). When this button is used I want it to pull certain data for that specific line from the query and input it into the new record opened by the button. I know this is possible as I use another db that does this but I have not been able to figure out how to make it work in the new db.

PS - I am a self taught newbie with limited skills so please be gentle. Just a point in the right direction would be greatly appreciated.
 
Perhaps you could set a value for the OpenArgs property of the form being opened when the button that opens the form is clicked by setting the OpenArgs argument of Docmd.OpenForm (see http://www.datawright.com.au/access_resources/access_docmd.openform_arguments.htm for details of this)
When the second form opens check its OpenArgs property for a value. If it is Not Null then set the value of the relevant controls on that form to those of the original form.
If that's as clear as mud, let me know :)
 
Thank you for your response Bob but I do believe you are speaking in a foreign language. It sure looks like english but I did not understand a bit of it :confused:

I apologize for my inexperience.

Charlene
 
How about zipping your database and posting? You can remove anything personal/confidential first. We just need enough data to highlight the issue/problem.
 
JDraw,
I was able to remove the most sensitive data and condense the records down but would it be possible to send this to you in a PM. Not comfortable with posting publicly.
 
Sure. I'll watch for it.
 
Paul,
That sounds like it might be what I am looking for. Now to figure out how to read and apply the code to my situation. At least it gives me an avenue to research. Thanks!
 
JDraw,
I must be brain dead today but I do not see a messaging option here. How can I send this to you without posting it publicly?
 
You can send a message by clicking on the poster's name in the upper left portion of the post and follow the flow, but I don't think you can attach a file to the message.

You could post the file to an external site, then message me with the coordinates.
 
Paul,
That sounds like it might be what I am looking for. Now to figure out how to read and apply the code to my situation. At least it gives me an avenue to research. Thanks!

No problem; post back if you get stuck, but it's fairly easy.
 
OK everyone that has been helping me with this. In the old db that is working as I want my new DB to work I have found this:

Form Properties - On Activate - Event Procedure
Private Sub cmdCI_Click()
On Error GoTo Err_cmdCI

chkInsp = -1
If IsNull(txtDisk) Then
txtDisk = "0"
End If
DoCmd.OpenForm "frmNewInspection", acNormal

Exit_cmdCI:
Exit Sub

Err_cmdCI:
MsgBox Err.Description, , "Cast Iron Selection"
Resume Exit_cmdCI

End Sub

Private Sub cmdExit_Click()

DoCmd.Close

End Sub

Private Sub cmdGp_Click()
On Error GoTo Err_cmdGp

chkInsp = -1
If IsNull(txtDisk) Then
txtDisk = "0"
End If
DoCmd.OpenForm "frmNewGPInt", acNormal

Exit_cmdGp:
Exit Sub

Err_cmdGp:
MsgBox Err.Description, , "GP Selection"
Resume Exit_cmdGp

End Sub

On the GP command button - On Click - Event Procedure (similar for CI command button).
Private Sub cmdGp_Click()
On Error GoTo Err_cmdGp

chkInsp = -1
If IsNull(txtDisk) Then
txtDisk = "0"
End If
DoCmd.OpenForm "frmNewGPInt", acNormal

Exit_cmdGp:
Exit Sub

Err_cmdGp:
MsgBox Err.Description, , "GP Selection"
Resume Exit_cmdGp

End Sub

This portion:
chkInsp = -1
If IsNull(txtDisk) Then
txtDisk = "0"

I believe pertains to labeling a disk location for pictures that is no longer used.

I do not see how this would populate the record fields in the form that the command buttons are opening so this may not help at all.
 
Thank you for your response Bob but I do believe you are speaking in a foreign language. It sure looks like english but I did not understand a bit of it :confused:

I apologize for my inexperience.

Charlene
No apology needed. We are all at our own level of knowledge and experience and all looking to learn more than we currently know.

Would it help if I create an example db and post it.
 
ladytriker
The attached db may help you to understand the method I suggested in post #2
 

Attachments

Bob and Paul,
You guys have been great. I really appreciate all the help. After taking a breather from this over the weekend and using what you guys have told me I think I may have the solution. Let me give it a try and see what happens and I will let you know if it poses more questions (or should I say when it poses more questions). Wish me luck!

Charlene
 
Bob and Paul,
You guys have been great. I really appreciate all the help. After taking a breather from this over the weekend and using what you guys have told me I think I may have the solution. Let me give it a try and see what happens and I will let you know if it poses more questions (or should I say when it poses more questions). Wish me luck!

Charlene
OK. Good Luck ! :D
 
Just an update....I was able to get my form to pull the query data in and save it to the new record on my test DB at home. Going to try to recreate it in my "real" db tomorrow. Only quirk in my test was that the data pulled through into all three tabs of my form instead of just in the first tab but I figure I can look into that if it happens on the "real" db. Wish me luck and be ready for new questions as I hopefully move forward to the next step in this monster I have created. Thanks for all your help!
 

Users who are viewing this thread

Back
Top Bottom