query not filling form

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,

I have a form that I would like to work in the same way as
a report I have set up. When you open up the report...
the user is prompted to "enter name"... then the fields of
that particular name are pulled from a table and inserted
into the report. Pretty straight foward.

However, I am not having luck with trying to ask the same
query to fill in my empty form. When I open up the
form... the form opens up empty... it seems that the query
asking the user to "enter name" is not being run. When I
go to the queries tab and click on the query I'm trying to
run... the query works fine. I have the form's control
source set to the query's name... not sure what I am
missing. The query runs fine with the report, but not
with the form. First, is it possible to fill an empty
form with data from a table like you would the same way
with a report? Second, what would I be missing to make
this work?

Any help would be greatly appreciated! Thanks, Mark
 
Mark,

I just tested it and it works fine -the query should work exactly like the
report
I presume you are using a parameter in the query that prompts for the name?

Does your query have any additional references to the report?

HS
 
Hello Habib,

Glad to hear from you. I know everyone here has been
seeing a lot of me lately. And I have to say that your
help has been GREAT!!!

As far as my question about my query not filling my
form... your right, everything is set up correctly. I did
go into the "Form properties" and under "Data" I had "Data
Entry" checked as Yes instead of No. Apparently,
the "Data Entry" selection only allows new records to be
added and not the existing/old data from the table to be
called up into my form. So, my form is now working with
the execption of one thing...

How do I now get my form to display a text box within
a "Option Group"? Let me explain more... On my form I
have a "Option Group" that has 7 check boxes. One check
box is listed as "other" and when that box is selected a
text box is made "visible" (I do not want the user to be
able to fill in the text box unless "other" is selected).
Now, when I open my form (with data from an existing table
filling in the form) and "other" has been selected... I
would like the text box to be visible, so the information
can be seen. What would be the way to make this work? I
hope I have explained myself well enough.

Thanks again Habib for all of your help!!!!!
 
Mark,
First, Where are you storing the Other info?
I'll assume your source query has 2 Columns
OptionType Which is bound to the option Group and
OptionValue: Which stores the value of the Other captured value.

You can't have the textbox be a member of the option group,
but you can certainly have it outside.
Add a text box - txtOptionValue bound to OptionValue.

In the form's current event, and in the check Box's After update and Exit
events,
if me.chkOption7 = True then
me.txtOptionValue.Visible = true
Else
me.txtOptionValue.Visible = false
End if

HS
 
Back
Top