I have a aquired a Fox Pro database<br>
It's an Order database.<br>
The order number for some "Martian" (read strange) reason is embeded in a description field like so:<br>
MARY SMITH (order #1075)<br>
This is in a order details table.<br>
So there is a record for each part on the order.<br>
I want to set the subforms recordsouce to just those records.<br>
My SQL code is normally:<br>
"SELECT * FROM DetailsTable WHERE [IDESC] = " & Me!OrderNum<br>
I changed it to <br>
"SELECT * FROM DetailsTable WHERE [IDESC] Like '*" & Me!OrderNum & "*';"<br>
But it returns more than just the order I need <br>
It returns all of the records for every order that has 75 in it<br>
like 175, 75, and 1075<br>
I need to be able to have a SQL statement that just looks at the 1075 inside of the IDESC field.<br>
Something on the lines of<br>
"SELECT * FROM DetailsTable WHERE Mid([IDESC],15,4) Like '*" & Me!OrderNum & "*';"<br>
Of course that does not work.<br>
<br>
TIA<br>
<br>
<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
It's an Order database.<br>
The order number for some "Martian" (read strange) reason is embeded in a description field like so:<br>
MARY SMITH (order #1075)<br>
This is in a order details table.<br>
So there is a record for each part on the order.<br>
I want to set the subforms recordsouce to just those records.<br>
My SQL code is normally:<br>
"SELECT * FROM DetailsTable WHERE [IDESC] = " & Me!OrderNum<br>
I changed it to <br>
"SELECT * FROM DetailsTable WHERE [IDESC] Like '*" & Me!OrderNum & "*';"<br>
But it returns more than just the order I need <br>
It returns all of the records for every order that has 75 in it<br>
like 175, 75, and 1075<br>
I need to be able to have a SQL statement that just looks at the 1075 inside of the IDESC field.<br>
Something on the lines of<br>
"SELECT * FROM DetailsTable WHERE Mid([IDESC],15,4) Like '*" & Me!OrderNum & "*';"<br>
Of course that does not work.<br>
<br>
TIA<br>
<br>
<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>