By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,256 Members | 1,700 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,256 IT Pros & Developers. It's quick & easy.

Search for record based on form entry when recordset is query

P: 4
Good morning!

I am using Access 2007. I have two forms that are for other users to enter data.

Form 1 is strictly a "search" type form. There are two command buttons to allow the user to search by idea number or project number. Once the user enters the appropriate number they click the command button and the following code executes:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command5_Click()
  3. DoCmd.OpenForm "Project Contacts", , , "[Idea Number]=" & Me![Text1]
  4. Me.Text1 = ""
  5. Me.Refresh
  6. DoCmd.Close acForm, "ProjectSearch ProjContacts"
  8. End Sub
  11. Private Sub Command6_Click()
  12. DoCmd.OpenForm "Project Contacts", , , "[CCR]=" & Me![Text3]
  13. Me.Text3 = ""
  14. Me.Refresh
  15. DoCmd.Close acForm, "ProjectSearch ProjContacts"
  16. End Sub
This code works perfectly when the DATA FORM opening has a recordset of a table. However, I have some forms that use a recordset of a query. This is where I'm running into trouble.

Is there a way to have the "DATA FORM" open for only the record indicated on by "SEARCH FORM" when the recordset of the "DATA FORM" is a query?

Attached are examples of what the forms look like.

Thank you!
Attached Files
File Type: docx Doc1.docx (90.8 KB, 216 views)
Apr 9 '14 #1
Share this Question
Share on Google+
3 Replies

Seth Schrock
Expert 2.5K+
P: 2,951
When you say you are running into trouble, what are you meaning? Do you get an error message?
Apr 9 '14 #2

P: 4

I'm not able to see your reply on the board for some reason however, I'll answer from the inbox response I got. So if there was more to your reply, I apologize!

When I say I'm having trouble, the DATA FORM opens, but it opens blank, rather than opening for the record indicated in the SEARCH FORM. No errors are's simply opening blank.
Apr 9 '14 #3

Expert Mod 5K+
P: 5,397

Comment out Line 4 and line 13 and try opening the forms that use a query and see if this helps any... - this is only a hunch as I don't have time today to check this in my test database (^_^)


If the images you have are of the standard jpeg/gif/bmp format, there is no need to enclose them in a document.

You can upload these directly using the advanced post editor the same way you uploaded the docx file.

Please understand, many of us cannot or will not d/l un-requested attachments. This has absolutely nothing to do with who you are... In my case, such d/l are prohibited by my ITSec staff. For many others, it is part of "safe computing/best practices" not to d/l such files. A practical example as to why can be found here this unfourtunate Member opened a file from a trusted source and is now haveing all sorts of issues!
Apr 9 '14 #4

Post your reply

Sign in to post your reply or Sign up for a free account.