Open Form ...

K

Kim

I am using the following statement to open a form -
DoCmd.OpenForm "Search Engineering Files", , , "File_Num
= 'PlanNumber'"

But it doesn't take the PlanNumber I am accepting in
my current form.

I tried replacing 'PlanNumber' with value, it shows me
desired results.

My question is what am I doing wrong.

Before this statement, I tried displaying the value
of PlanNumber, it shows correct value.

Thank you in advance.

-Kim
 
D

Dirk Goldgar

Kim said:
I am using the following statement to open a form -
DoCmd.OpenForm "Search Engineering Files", , , "File_Num
= 'PlanNumber'"

But it doesn't take the PlanNumber I am accepting in
my current form.

I tried replacing 'PlanNumber' with value, it shows me
desired results.

My question is what am I doing wrong.

Before this statement, I tried displaying the value
of PlanNumber, it shows correct value.

Thank you in advance.

-Kim

My guess is that you want this:

DoCmd.OpenForm "Search Engineering Files", , , _
"File_Num = '" & PlanNumber & "'"
 
K

Kim

Dirk,

This works, how to make this form readonly?
I tried acFormReadOnly some place, I ran into problems.

Appreciate your help!

-Kim
 
K

Kim

Dirk,

I want to be able to view 'Search Engineering Form'
as Read Only and then Display another form for
data entry, Is it possible to leave both the forms open
side by side? Or maybe display 'Search Engineering Form'
on top and lower portion display the data entry form?

Thank you,
-Kim
 
P

PC Datasheet

Kim,

Open your form in design view, open properties and go to the Data tab. Set Allow
Additions and Allow Edits to No; this effectively makes your form Read Only.

Create a new unbound form. Insert the Search Engineering Form and your other
form as separate subforms on this new form. The main form is just a container
for the subforms and doesn't do anything. You can then enter data in the other
form while viewing Search Engineering Form.
 
D

Dirk Goldgar

Kim said:
Dirk,

This works, how to make this form readonly?
I tried acFormReadOnly some place, I ran into problems.

Probably in the wrong place, because that's the right keyword. Try
this:

DoCmd.OpenForm "Search Engineering Files", , , _
"File_Num = '" & PlanNumber & "'", _
acFormReadOnly

Or, to minimize confusion, you could use named arguments:

DoCmd.OpenForm "Search Engineering Files", _
WhereCondition:="File_Num = '" & PlanNumber & "'", _
DataMode:=acFormReadOnly

Be aware, though, that when you open a form in read-only mode, all
controls on the form become uneditable -- even unbound controls.
 
D

Dirk Goldgar

Kim said:
Dirk,

I want to be able to view 'Search Engineering Form'
as Read Only and then Display another form for
data entry, Is it possible to leave both the forms open
side by side?

I don't see why not. Have you tried it? Is there some problem?
Or maybe display 'Search Engineering Form'
on top and lower portion display the data entry form?

You could put put both of these forms as subforms on a main form, I
suppose. I'm not sure what you're after, but that sounds like what
you're describing.
 
K

Kim

Thank you,
-K
-----Original Message-----
Kim,

Open your form in design view, open properties and go to the Data tab. Set Allow
Additions and Allow Edits to No; this effectively makes your form Read Only.

Create a new unbound form. Insert the Search Engineering Form and your other
form as separate subforms on this new form. The main form is just a container
for the subforms and doesn't do anything. You can then enter data in the other
form while viewing Search Engineering Form.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com





.
 
K

Kim

Dirk,

Thank you for your replies!
I tried it before, I ran into some problem I can't
remember. But now it seems to be working.

-Kim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top