Restrict text field in subform

S

sap4ora

Hello all,
I have a text field that could be “Approveâ€, Reject, and/or “Pending†in a
subform that was build with a table as the source. I have a main form that
talks to the subform and what I need is to set the control source for the
above text to show “Approveâ€, “Rejectâ€, and Pending but not all together
since I would like to see a main form for approve, reject and pending with
out changing the subform.

Regards,
 
J

Jonathan

sap4ora said:
Hello all,
I have a text field that could be “Approveâ€, Reject, and/or “Pending†in a
subform that was build with a table as the source. I have a main form that
talks to the subform and what I need is to set the control source for the
above text to show “Approveâ€, “Rejectâ€, and Pending but not all together
since I would like to see a main form for approve, reject and pending with
out changing the subform.

Regards,

Hi, perhaps build a combobox using the controls wizard. Have the row source
type value list with these 3 options listed (If this list is likely to change
over time then it is better to store in a table and have this table as the
row source for the combo box.). In the properties, set limit to list as yes.

Luck
Jonathan
 
S

sap4ora

Hi There,

I have built 3 queries to give me the three conditions. My question now is
how can I update the text field’s control Source on my subform to include one
or all of these queries that will fix the problem.



Thanks,
 
J

Jonathan

sap4ora said:
Hi There,

I have built 3 queries to give me the three conditions. My question now is
how can I update the text field’s control Source on my subform to include one
or all of these queries that will fix the problem.



Thanks,

Sounds like I need more information... without creating a novel please
briefly describe the tables/queries and linking fields for the main and sub
forms; plus the purpose of each form.

Luck, Jonathan
 
S

sap4ora

Hi Jonathan,

Thanks for your help. Here is what I have.
I have a main form that has one combo box made of value list of 6 items.
Once the user select an item the subform shows the detail records for that
item, the subform includes an item state that the user works with (Approve,
Reject, and Pending). The state field is bound to the table that is the
source for the subform. I want to keep these 3 states to show independent of
each other, my approach is to make 3 copies of the subform one for each state
by changing it’s source and attach it to the main form using the same method
I’m currently using and change the main form naming to – Approve, Reject and
Pending. As you can see I want the users to access the form they need.

What I have tried:
1-Created queries for each state and change the state source to the queries?
The state column show #Error when the subform viewed, the subform doesn’t
recognize the queries since it is not listed on the state’s field source when
the drop down arrow used. How can I update that list without recreating the
subform?


Thanks,
 
J

Jonathan

Hi, here are some options to try to isolate the #Error:

- with the form open can you switch to the database window to open each of
your queries to determine that each query gives you the result that you want.
Here I'm assuming that each query returns a field with a name that matches
the control source for your state control.

- sometimes calculations in query columns fail to work when these queries
are used as a record source for forms/subforms. Consider creating a
function(s) in a standard module. Call this function from the query (you may
have to pass to this function field values as parameters). This applies even
for otherwise simple references to a form control.

Luck
Jonathan
 
Top