harkirat777
New member
- Local time
- Today, 05:46
- Joined
- Jul 23, 2013
- Messages
- 4
Hi,
I was writing a code for a form to export the table (Intro_1) for a field which is specified in a textbox(selectID1), then clicking on a button to export to XML (Exported_XML.xml), using the WhereCondition:
The code does not export anything.
However, if I hardcode the ID value in WhereCondition, i.e without picking up the value from the textbox:
it works absolutely fine. :banghead:
Can anyone help me how to use the value entered in the textbox in WhereCondition please.
I have done a lot of head scratching, cannot find out why. I used another textbox to capture the value of 'Me.selectID1' which is 5, it is receiving the right value, still does not work.
I was writing a code for a form to export the table (Intro_1) for a field which is specified in a textbox(selectID1), then clicking on a button to export to XML (Exported_XML.xml), using the WhereCondition:
Code:
Public Sub Command9_Click()
Application.ExportXML ObjectType:=acExportTable, _
DataSource:="Intro_1", _
DataTarget:="E:\VBAx\Exported_XML.xml", _
WhereCondition:="ID='Me.selectID1'"
End Sub
The code does not export anything.

However, if I hardcode the ID value in WhereCondition, i.e without picking up the value from the textbox:
Code:
WhereCondition:="ID='5'"
Can anyone help me how to use the value entered in the textbox in WhereCondition please.
I have done a lot of head scratching, cannot find out why. I used another textbox to capture the value of 'Me.selectID1' which is 5, it is receiving the right value, still does not work.