March 24th, 2013, 05:13 AM
Send an ADODC to another Form
I have a form "frmSearch", it contains an ADODC, multiple comboboxes and a text box infront of each combo box. Here is a picture of that.
The form will use an ADODC to full combobox with all the available fields in that ADODC, and the combobox together with textbox infront of it will narrow down records in adodc according to search criteria
I've got multiple forms that contain multiple ADODCs each. Usually 2 or 3 ADODC each.
They all load the form "frmSearch" when the button "cmdSearch" is clicked. I want to send a specific adodc in from each form to "frmSearch", so it can fill the combo boxes.
The problem I'm having is how will the "frmSearch" know which ADODC in a form to alter. The form "FrmCustomer" contain 2 ADODCs, "adoCustomer", and "adoCustomerContact". I can't just do the following and use the variable to access that particular ADODC.
Public ADO as string
Private Sub Command1_Click()
ADO = adoCustomer.name
March 24th, 2013, 10:03 AM
Re: Send an ADODC to another Form
You really should not be using the ADODC. Bound controls are not such a good idea either. Much better to use code instead for several reasons.
As for passing something to another form you do it by passing it as a parameter. Create a sub routine on your form that accepts the object as a parameter and then pass that object. Or you can reference the actual data control by using the name of the form and the control. ie. FrmCustomer.adoCustomer
Though here I am not sure why you would need to send a data control.
Always use [code][/code] tags when posting code.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.