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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Specify the date of a WeekDay



 
 
Thread Tools Display Modes
  #11  
Old May 12th, 2009, 02:44 PM posted to microsoft.public.access
Clif McIrvin[_2_]
external usenet poster
 
Posts: 629
Default Specify the date of a WeekDay

"TraciAnn via AccessMonster.com" u50702@uwe wrote in message
news:95f7684ab8aa3@uwe...
Clif,

I've tried both, and they give me the same result (#Name?):

After I posted this I remembered that the name of the subform *control*
is not the name of the *subform* (unless you renamed the subform
control.) That is to say, in this code (both
forms)fsubContactTrainSchedule needs to refer to the subform control on
the mainform.

Clear as mud?

--
Clif

=DateAdd("d",1-Weekday([Forms].[frmContact].[fsubContactTrainSchedule].
[TrainScheduleDate],4),[Forms].[frmContact].[fsubContactTrainSchedule]!
[TrainScheduleDate])

OR

=DateAdd("d",1-Weekday([Me].[Parent].[fsubContactTrainSchedule].
[TrainScheduleDate],4),[Me].[Parent].[fsubContactTrainSchedule]!
[TrainScheduleDate])


Location of text control with the expression:
Forms.frmContact.fsubCommunication.txtTrainingRemi nderScheduled

My understanding tells me this should be able to be accomplished with
just a
simple expression like the one John provided but maybe I need to go to
a more
complex code.

Any ideas?

--
---
TraciAnn

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200905/1




--
Clif


  #12  
Old May 12th, 2009, 03:30 PM posted to microsoft.public.access
TraciAnn via AccessMonster.com
external usenet poster
 
Posts: 178
Default Specify the date of a WeekDay

After I posted this I remembered that the name of the subform *control*
is not the name of the *subform* (unless you renamed the subform
control.) That is to say, in this code (both
forms)fsubContactTrainSchedule needs to refer to the subform control on
the mainform.

Clear as mud?



Huh?

--
---
TraciAnn

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200905/1

  #13  
Old May 12th, 2009, 03:50 PM posted to microsoft.public.access
Clif McIrvin[_2_]
external usenet poster
 
Posts: 629
Default Specify the date of a WeekDay

"TraciAnn via AccessMonster.com" u50702@uwe wrote in message
news:95f88563bc208@uwe...
After I posted this I remembered that the name of the subform
*control*
is not the name of the *subform* (unless you renamed the subform
control.) That is to say, in this code (both
forms)fsubContactTrainSchedule needs to refer to the subform control
on
the mainform.

Clear as mud?



Huh?


When you put a subform into a mainform, the mainform has a "subform
control" and the subform "lives" inside that subform control.

When you open a mainform (frmContact) Access adds that form to the
Forms collection, so you can refer to it by Forms!frmContact.

However, subforms (fsubContactTrainSchedule ) are *not* added to the
forms collection, so Forms!fsubContactTrainSchedule will fail.

When you are in a procedure in a form, you refer to controls on the form
by using the control's name:
Me.txtboxName ...

To refer to a control on a subform from the mainform, you have to drill
down to the subform:

Me.NameofSubFormControl.NameofControlOnSubForm

In form design view, you can find the subform control and look at it's
properties to discover it's name (as opposed to the form it contains.)

Does this help?


--
Clif


 




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 05:26 AM.


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