473,472 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I want to Access a Subform based on a selection in another form

MattFitzgerald
30 New Member
When I open my database I have a comand button "Search Orders By VOL"

This opens a form containing a dropdown list "Combo4" from here I select my order reference [VOL Ref] e.g. VOL011-0000000004 and click a command button "Open Customer Orders" which opens a form "Frm_LE_List" to the correct customer [LE ID], but I do not know how to make the Subform "Frm_VOL_References" open to the correct [VOL Ref].

Here is the code "on click" of command button "Open Customer Orders" :-

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command7_Click()
  2. On Error GoTo Err_Command7_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "Frm_LE_List"
  8.  
  9.     stLinkCriteria = "[LE ID]=" & Me![LE ID]
  10.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  11.  
  12. Exit_Command7_Click:
  13.     Exit Sub
  14.  
  15. Err_Command7_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_Command7_Click
Please can someone help as I have spent 2 Days trying to figure this one out.

I will attach my database so you can see better the problem.

Any help is much appreciated Matt Fitzgerald
Attached Files
File Type: zip Copy of 2008_2009 V5.zip (104.7 KB, 71 views)
Mar 11 '08 #1
1 1118
JustJim
407 Recognized Expert Contributor
When I open my database I have a comand button "Search Orders By VOL"

This opens a form containing a dropdown list "Combo4" from here I select my order reference [VOL Ref] e.g. VOL011-0000000004 and click a command button "Open Customer Orders" which opens a form "Frm_LE_List" to the correct customer [LE ID], but I do not know how to make the Subform "Frm_VOL_References" open to the correct [VOL Ref].

Here is the code "on click" of command button "Open Customer Orders" :-

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command7_Click()
  2. On Error GoTo Err_Command7_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "Frm_LE_List"
  8.  
  9.     stLinkCriteria = "[LE ID]=" & Me![LE ID]
  10.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  11.  
  12. Exit_Command7_Click:
  13.     Exit Sub
  14.  
  15. Err_Command7_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_Command7_Click
Please can someone help as I have spent 2 Days trying to figure this one out.

I will attach my database so you can see better the problem.

Any help is much appreciated Matt Fitzgerald
Hi,

Check out NeoPa's article here

Jim
Mar 20 '08 #2

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

Similar topics

7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
1
by: Donna Sabol | last post by:
I have a form (frm_MAIN_RPT) that contains a combo box (Combo6) & subform (dbo_REQ_subform). The combo box is used to select the "cost center" data that will be displayed in the subform. From...
2
by: Terry | last post by:
Hello, I wonder if anyone can shed light on this problem for me. I have an Access 97 front end with an SQL 2000 database. There is a Business main form with an Owner subform and corresponding...
1
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
6
by: Tim K. | last post by:
Howdy, I'm looking for only a few hints - I need to figure as much of this out on my own as possible so I'll learn it. I'm doing a field study on a mosquito impoundment on some mangrove islands...
1
by: jerry.ranch | last post by:
So I've been playing with combo boxes and subforms. Finally, I can make a selection in a combo box, and have that drive an after update event to open a query or a form. Works famously. Now the...
6
by: ARC | last post by:
Ok, so I'm looking at Access 2007, and I have imported my existing Access 97 application. I'm feeling a bit overwelmed in what to do here. In my original 97 application, I had one form: Mainmenu,...
8
by: NJonge01 | last post by:
Great thanks to all the helpful responses I've read! Recently using MS Access after a lengthy (7-10 years) away from the tool. I apologize for posting a question that for all intents & purposes...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.