Picking up criteria from form box

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

I have a query which works fine if I put the Like"*Oil" criteria in the
design grid. But what I want to do is take the Like value fron a form box.

I have tried Like [form and box name] and Like"*[form and box name] but
without success. The Box is an unbound free text entry.

What is the correct syntax please.

Thanks

Les
 
I have a query which works fine if I put the Like"*Oil" criteria in the
design grid. But what I want to do is take the Like value fron a form box.

I have tried Like [form and box name] and Like"*[form and box name] but
without success. The Box is an unbound free text entry.

What is the correct syntax please.

Thanks

Les

Like "*" & forms!FormName!ControlName
to find records in which the field ends with the entry in the control.

Like forms!FormName!ControlName & "*"
to find records in which the field begins with the entry in the
control.

Like "*" & forms!FormName!ControlName & "*"
to find records in which the field contains the entry in the control
anywhere in the field.

Change FormName to the actual name of the form.
Change ControlName to the actual name of the control.
 
Hi Les

Use vertical bars around the textbox reference:

Like "*|[Forms]![YourForm]![YourTextBox]|*"
 
Thats great one problem that as occured that I did not concider is the fact
that the user can now change the field contents which they should not have
access to. Other than displaying the list in a locked form is there a way
of preventing this?

Thanks

Les


fredg said:
I have a query which works fine if I put the Like"*Oil" criteria in the
design grid. But what I want to do is take the Like value fron a form box.

I have tried Like [form and box name] and Like"*[form and box name] but
without success. The Box is an unbound free text entry.

What is the correct syntax please.

Thanks

Les

Like "*" & forms!FormName!ControlName
to find records in which the field ends with the entry in the control.

Like forms!FormName!ControlName & "*"
to find records in which the field begins with the entry in the
control.

Like "*" & forms!FormName!ControlName & "*"
to find records in which the field contains the entry in the control
anywhere in the field.

Change FormName to the actual name of the form.
Change ControlName to the actual name of the control.
 
Thats great one problem that as occured that I did not concider is the fact
that the user can now change the field contents which they should not have
access to. Other than displaying the list in a locked form is there a way
of preventing this?

Thanks

Les

fredg said:
I have a query which works fine if I put the Like"*Oil" criteria in the
design grid. But what I want to do is take the Like value fron a form box.

I have tried Like [form and box name] and Like"*[form and box name] but
without success. The Box is an unbound free text entry.

What is the correct syntax please.

Thanks

Les

Like "*" & forms!FormName!ControlName
to find records in which the field ends with the entry in the control.

Like forms!FormName!ControlName & "*"
to find records in which the field begins with the entry in the
control.

Like "*" & forms!FormName!ControlName & "*"
to find records in which the field contains the entry in the control
anywhere in the field.

Change FormName to the actual name of the form.
Change ControlName to the actual name of the control.
Set the form's control to
Enable = No.
Or
Locked = Yes
Or
Enabled= No and Locked = Yes
Or...
Set the Form's Allow Edits property to No
 
Thanks for that

Les

fredg said:
Thats great one problem that as occured that I did not concider is the fact
that the user can now change the field contents which they should not have
access to. Other than displaying the list in a locked form is there a way
of preventing this?

Thanks

Les

fredg said:
On Thu, 17 Jun 2004 22:37:28 +0100, Les wrote:

I have a query which works fine if I put the Like"*Oil" criteria in the
design grid. But what I want to do is take the Like value fron a form box.

I have tried Like [form and box name] and Like"*[form and box name] but
without success. The Box is an unbound free text entry.

What is the correct syntax please.

Thanks

Les

Like "*" & forms!FormName!ControlName
to find records in which the field ends with the entry in the control.

Like forms!FormName!ControlName & "*"
to find records in which the field begins with the entry in the
control.

Like "*" & forms!FormName!ControlName & "*"
to find records in which the field contains the entry in the control
anywhere in the field.

Change FormName to the actual name of the form.
Change ControlName to the actual name of the control.
Set the form's control to
Enable = No.
Or
Locked = Yes
Or
Enabled= No and Locked = Yes
Or...
Set the Form's Allow Edits property to No
 
Back
Top