Hello all,
Can someone expline how I can attach an ADODB Recordset ( backend is SQL) to a form. Here is the code I currently use:
Dim conn As New ADODB.Connection
Dim CMD As New ADODB.Command
Dim strSQL As String
Set conn = New ADODB.Connection
Set CMD = New ADODB.Command
Set ImportRs = New...
Here is the solution:
Place a subform in your main form. In your main form add something to the recordsource otherwise you can not access the recordsource of the subform. After you have tested the code you can take out whatever you have place in the main form's recordsource.
Here is what I am running into. I have a form that is unbound until the user sets the criteria for the SQL that I build from code. The user does this by means of combobox, checkboxes, etc... each of which is unbound. Now, everything works until I set the record source. Once the record source is...
Found the problem:
The ComboBox is Unbound. Anytime I put a query in the Record Source of the Form the combobox is unknown or null and is not seen in the OnChange event.
Bob,
Wow thanks. Just so i understand. If I have a unbound combobox on in the header of a form, what will the best way of accessing the text property of the combobox?
Well, I pull this code from an example and left it as such. I agree not needed.
To note: I have this exact same code in another form and it works.
Let me provide you with a bit of background to what Im trying to do.
I want to have the user type in char on the 3rd char i do a search and...
pbaldy:
Notice in the code i have commented out the .Text
this was tried. It seems like the control is not being passed back to the event.
Again thanks for your time.
Bob Thanks for the quick reply.
But, I'm not sure I follow. What should I have to put into the OnAfterUpdate.
Here is a screen shot of what the debugger is telling me:
To note:
It is almost like the form is disassociated from the module. Me does not report as null in development but once i run the code it looks null.
Argh?
I have a combobox with a OnChange event and im calling the following code:
Private Sub cbCompanyName_Change()
Dim cbo As ComboBox
Dim sText As String
cbo = Me.Controls("cbCompanyName")
'Set cbo = Me.cbCompanyName
sText = cbo.Value
'sText = cbo.Text
'sText =...
I have a form with 6 unbound checkboxes, 6 comboboxes, 1 button in the header and several bound fields in the detail section.
When a user clicks the button, VBA code runs that generates SQL based on which critera ( 6 comboboxes ) then the SQL is passed in to the RecordSource of the form and a...