By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,715 Members | 1,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,715 IT Pros & Developers. It's quick & easy.

Form Appearance

P: 7
I would like to have the area on my form, where a subform is located, to be an empty box with a border when the main form is initially opened. Then when user clicks on a button, the actual fields comprising the subform are visible, ready for the user to enter the required data.

The main form is an initial entry point in which the user can select four options (Insert new data, delete existing data, query exisiting data, and save data), which is why I would like the inital appearance of the form to be the four buttons and an empty box where the subform will eventually be displayed.

Any suggestions?!

Thanks

Hawg1
Sep 23 '06 #1
Share this Question
Share on Google+
7 Replies


PEB
Expert 100+
P: 1,418
PEB
Ok,
In your on Open Event procedure you type:

If your subform is based on columns / datasheet:

Expand|Select|Wrap|Line Numbers
  1. Me![SUBFORM].Form![F1].ColumnHidden = True
  2. Me![SUBFORM].Form![f2].ColumnHidden = True
  3.  
  4.  
If your subform is like form view:

Expand|Select|Wrap|Line Numbers
  1. Me![SUBFORM].Form![F1].Visible = False
  2. Me![SUBFORM].Form![f2].Visible = False
  3.  
In the case of form view it's better to put a rectangle box on top that you change its visible option to visible or invisible!

:)
Sep 24 '06 #2

P: 7
PEB,

Thanks for the code suggestion. I understand that the name of the subform goes into the [SubForm] part of the code.

I'm unsure what should go into the [F1] or [F2] part. Could you please elaborate for me? I'm new to VBA and am slowly learning all of the terminology.

Thanks for your help

Hawg1
Sep 24 '06 #3

PEB
Expert 100+
P: 1,418
PEB
No, no, no

This code you have to place it in your Main Form, On Open Event you assign Event procedure and you store the code there!

SUBFORM is the name of the control that is stored your subform

AND f1 f2 and so on are the names of the fields in your subform that you want to control from your main form

Now is it more clear?

Hope yeah!

Best regards!

:)
Sep 24 '06 #4

P: 7
PEB,

I'm probably losing it as I can't seem to get it to work. I keep getting error messages that state 'can't fine field...'

So I figured I would start over some what. I created a new blank form called hide test in design view. I then draged the form PersAction_PersData (contains several text/combo boxes) onto the detail section of the form hide test. Save and open the form and the subform is present.

I then enter the following into the OnOpen event of the form hide test (to save time, I only used the first text box on the subform):

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. Me!PersAction_PersData.Form!SSN.Visible = False
  3.  
  4. End Sub
When I open the form I get the following error:

RunTime Error '2465':
MS Office Access can't find the field 'PersAction_PersData' referred to in your expression.


What am I missing or doing wrong?


No, no, no

This code you have to place it in your Main Form, On Open Event you assign Event procedure and you store the code there!

SUBFORM is the name of the control that is stored your subform

AND f1 f2 and so on are the names of the fields in your subform that you want to control from your main form

Now is it more clear?

Hope yeah!

Best regards!

:)
Sep 24 '06 #5

PEB
Expert 100+
P: 1,418
PEB
Hi,
The only reason to have this error is that the control

PersAction_PersData doesn't exist in your form!

Pls check the name of your control that is stored your form and verify that it's name is:

PersAction_PersData

This is not name of form but name of control!

:)
Sep 25 '06 #6

P: 7
PEB,

Thanks for the help. I got her working. I finally decided to just delete the subform and install a new one on the main form and everything is working.

Hi,
The only reason to have this error is that the control

PersAction_PersData doesn't exist in your form!

Pls check the name of your control that is stored your form and verify that it's name is:

PersAction_PersData

This is not name of form but name of control!

:)
Sep 26 '06 #7

PEB
Expert 100+
P: 1,418
PEB
Good solution !

Best regards!

:)
Sep 27 '06 #8

Post your reply

Sign in to post your reply or Sign up for a free account.