G
Guest
Hi there! I'm looking for a little help regarding the following:
I have a combo box with a SQL statement as it's source.
In response to a command button event, the row source changes to a different
SQL statement.
My question: How do I revert to the original SQL statement later, in
response to a different command button event? I know that I could just set
the .rowsource property to the SQL statement, but I'm having trouble with
that because my SQL statement has some characters in it that are causing
problems in vba.
_______________
Here's what the original row source looks like:
SELECT tblContact.ContactID, tblContact.ContactDivision,
tblContact.ContactLastName, tblContact.ContactFirstName FROM tblContact WHERE
(((tblContact.ContactDivision)=Forms!frmBusDev!cboBusDevDivision)) ORDER BY
tblContact.ContactLastName;
When the event is triggered, it changes to this:
.RowSource = "SELECT tblContact.ContactID, " _
& "tblContact.ContactLastName, tblContact.ContactFirstName " _
& "FROM tblContact ORDER BY tblContact.ContactLastName;"
_______________
Is there a property already in vba that refers to the original (or default)
row source of a control before it was modified with code? I greatly
appreciate suggestions and any help you might be able to offer. Thanks!
I have a combo box with a SQL statement as it's source.
In response to a command button event, the row source changes to a different
SQL statement.
My question: How do I revert to the original SQL statement later, in
response to a different command button event? I know that I could just set
the .rowsource property to the SQL statement, but I'm having trouble with
that because my SQL statement has some characters in it that are causing
problems in vba.
_______________
Here's what the original row source looks like:
SELECT tblContact.ContactID, tblContact.ContactDivision,
tblContact.ContactLastName, tblContact.ContactFirstName FROM tblContact WHERE
(((tblContact.ContactDivision)=Forms!frmBusDev!cboBusDevDivision)) ORDER BY
tblContact.ContactLastName;
When the event is triggered, it changes to this:
.RowSource = "SELECT tblContact.ContactID, " _
& "tblContact.ContactLastName, tblContact.ContactFirstName " _
& "FROM tblContact ORDER BY tblContact.ContactLastName;"
_______________
Is there a property already in vba that refers to the original (or default)
row source of a control before it was modified with code? I greatly
appreciate suggestions and any help you might be able to offer. Thanks!