•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 427,379 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,008 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 1860 | Replies: 2
![]() |
•
•
Join Date: Jun 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi all,
I have a problem with a query in access that I cant seem to figure out. I have a form named frmRecruitment with a subform named sfrmParticipant. At the moment I am using an append query to append records from 'sfrmParticipant' to 'frmIntervention' using a button on a main form 'frmRecruitment'.
This append query appends all the records from
'sfrmParticipant' to 'frmIntervention' but I only want to append the record that is displayed as the current record in the form or the last record from tblParticipant into tblIntervention and by using the button on the form append only that very last record.
I modified the code to do this:
and yes it appends only the information being displayed or the very last record from tblParticipant into tblIntervention but it prompts me to enter the participantID in order to do it.
How do I modify the append query to only append the form record with out promting me and having to enter the participant ID manually?
Thanks for your help!
hikosj
I have a problem with a query in access that I cant seem to figure out. I have a form named frmRecruitment with a subform named sfrmParticipant. At the moment I am using an append query to append records from 'sfrmParticipant' to 'frmIntervention' using a button on a main form 'frmRecruitment'.
This append query appends all the records from
'sfrmParticipant' to 'frmIntervention' but I only want to append the record that is displayed as the current record in the form or the last record from tblParticipant into tblIntervention and by using the button on the form append only that very last record.
I modified the code to do this:
Private Sub Command31_Click() DoCmd.RunSQL "INSERT into [tblIntervention]([participantID]) VALUES (participantID)" End Sub
and yes it appends only the information being displayed or the very last record from tblParticipant into tblIntervention but it prompts me to enter the participantID in order to do it.
How do I modify the append query to only append the form record with out promting me and having to enter the participant ID manually?
Thanks for your help!
hikosj
Last edited by hikosj : Jun 6th, 2008 at 1:01 pm.
•
•
Join Date: Jun 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks evreyone for the "help" and suggestions,
I finally figured it out! It took me a while but I finally got it to work.
I added this to the click event of a button
I finally figured it out! It took me a while but I finally got it to work.
I added this to the click event of a button
Dim str As String str = Form_frmPresentation.presentationID.Value DoCmd.Close DoCmd.OpenForm "sfrmAppointmentOne", acNormal, , , , acWindowNormal, "Value=" + str And then I added this to the on load event of the form getting the variable Form_frmIntervention.participantID.Value = Form_frmParticipant.participantID.Value Me.Refresh
The answer to your original question as to why the query wasn't working is that you never gave it a WHERE clause to limit what it was doing.
Bob Larson
____________________________________
Access MVP
For Quick Tutorials and Samples for Microsoft Access: BTAB Development
____________________________________
Access MVP
For Quick Tutorials and Samples for Microsoft Access: BTAB Development
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS Access and FileMaker Pro Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- i need the help for a vb (Existing Scripts)
- sql query problem with MS Access and C# (C#)
- MS Access 2000 - Inserting records in a new table by joining input from two tables (Visual Basic 4 / 5 / 6)
- VB6 / Access DAO Add Field to Existing Table/Query (Visual Basic 4 / 5 / 6)
- registration (ASP.NET)
- Duplicate record and child records (MS Access and FileMaker Pro)
- Error Microsoft OLE DB/ODBC (0x80004005) Access (ASP)
- error (ASP)
- againt error (ASP)
- not-a-virusadware (Viruses, Spyware and other Nasties)
Other Threads in the MS Access and FileMaker Pro Forum
- Previous Thread: ACCES: Database placed in a state by user that prevents it from being opened
- Next Thread: Making design changes in Access 2003


Linear Mode