Winterwolf73
New member
- Local time
- Today, 15:09
- Joined
- Jul 3, 2020
- Messages
- 26
I have a form that pulls various data from my Customer Table. This form has three tab pages.
Page 1 - Customer Info: is simply a search option to see if a person has any entries. There is an unbound text field that I can enter the persons last name and it will pull all of the entries with said last name. This is working correctly. Though I am going to have to tweek it in the near future to include the customers first name in the query.
Page 2 - New Customer: this one is self explanatory.
Page 3 - Update Customer: This page has a search option by account number. This is also where one of my issues lay. I am using the persons account number for the search query. I want each of the editable field from the table to show up as separate controls inside this page. The query works fine. it is the displaying of the information I am having an issue with.
I have tried to drop the query directly on to the page. I was not happy with this, so i decided to create a form ( with the query as the record set). This i dropped in the main form as a sub-form. I like this. However, here is my first problem. When I enter the customer account number and click search the results show up as separate result "table". The sub-form does not display the results. Which leads me to problems 2 & 3. To see if the data has actually been populated in the sub-form, I hit refresh. The same pop-up windows show up. The first is for the Last Name and the second is for the Account Number. This would not be an issue, but it happens multiple times for each. The Account Number window also pops up when I click the search button.
Here is the code VBA code for the search function.
Code Tags Added by UG
Please use Code Tags when posting VBA Code
Please read this for further information:-
https://www.access-programmers.co.u...e-use-code-tags-when-posting-vba-code.240420/
Please feel free to Remove this Comment
I have attached a snippet of the form for reference.
Page 1 - Customer Info: is simply a search option to see if a person has any entries. There is an unbound text field that I can enter the persons last name and it will pull all of the entries with said last name. This is working correctly. Though I am going to have to tweek it in the near future to include the customers first name in the query.
Page 2 - New Customer: this one is self explanatory.
Page 3 - Update Customer: This page has a search option by account number. This is also where one of my issues lay. I am using the persons account number for the search query. I want each of the editable field from the table to show up as separate controls inside this page. The query works fine. it is the displaying of the information I am having an issue with.
I have tried to drop the query directly on to the page. I was not happy with this, so i decided to create a form ( with the query as the record set). This i dropped in the main form as a sub-form. I like this. However, here is my first problem. When I enter the customer account number and click search the results show up as separate result "table". The sub-form does not display the results. Which leads me to problems 2 & 3. To see if the data has actually been populated in the sub-form, I hit refresh. The same pop-up windows show up. The first is for the Last Name and the second is for the Account Number. This would not be an issue, but it happens multiple times for each. The Account Number window also pops up when I click the search button.
Here is the code VBA code for the search function.
Code Tags Added by UG
Please use Code Tags when posting VBA Code
Please read this for further information:-
https://www.access-programmers.co.u...e-use-code-tags-when-posting-vba-code.240420/
Please feel free to Remove this Comment
Code:
Private Sub Find_Account_Click()
'User must enter a value in the text box
If IsNull(Text184) = True Then
MsgBox "You must enter search criteria."
'Open query using search criteria entered
Else
DoCmd.OpenQuery "Query - Update Customer", acViewNormal
End If
End Sub
I have attached a snippet of the form for reference.
Attachments
Last edited by a moderator: