A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Changing the date



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2004, 04:52 PM
Allie
external usenet poster
 
Posts: n/a
Default Changing the date

My main form and sub form (datasheet) are linked by the
date field and another field. If the date is changed on
the main form, I would like the dates on the subform to
change automatically.

I've tried an If statement on the exit event of the date
on the main form with
forms!fSubForm!txtDate = forms!frmMainForm!txtDate

Problem: when the exit event of the main form date runs,
it gives the error message that it cannot find the sub
form.

Any suggestions?

  #2  
Old June 3rd, 2004, 05:05 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default Changing the date

Since the control is on the main form, we should be able to use Me for
Forms!frmMainForm to shorten things a little. Next, when a form is opened as
a subform, you can't refer to it directly by its name. You have to refer to
a control on the main form. This control is a container for the subform.

Example:
Me.ctlNameOfSubformControl.Form.txtDate

To get the name of the subform control, open the main form in design mode,
open the Properties sheet, and click on the subform ONE time. The properties
sheet should show the name of the subform control. If you click more than
once, you'll be in the subform and the Properties sheet will show the name
of the subform, not the control holding it.

--
Wayne Morgan
Microsoft Access MVP


"Allie" wrote in message
...
My main form and sub form (datasheet) are linked by the
date field and another field. If the date is changed on
the main form, I would like the dates on the subform to
change automatically.

I've tried an If statement on the exit event of the date
on the main form with
forms!fSubForm!txtDate = forms!frmMainForm!txtDate

Problem: when the exit event of the main form date runs,
it gives the error message that it cannot find the sub
form.

Any suggestions?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.