Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: Doing stuff by Date

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Doing stuff by Date
"Regan via AccessMonster.com" <u24090[ at ]uwe> 19.07.2006 23:16:48
hi. In my startup form i have a textbox withthe control source =Date()
[text27]. I have another textbox(unbound) [text29] where i want to put
another date. What i want to do is when [text27] = [text29] then 'do some
stuff' [text29] = [text27]. How do i put the a value in [text29] and keep it
there?. i put in 21/07/06 in the default value and when i reload the form it
comes up 30/12/1889. i haven't done programming but this is what i think i
want to do

Private Sub Form_Open(Cancel As Integer)

Dim DNW As Date
Dim DTD As Date
Dim stdocname As String

DTD = Text27.Value
DNW = Text29.Value
stdocname = "WageBal"

If DNW = DTD Then
Text29.Value = DTD + 7 ' and date stay there until it is reached again.
its not satying there now
DoCmd.OpenForm stdocname
'do some stuff and close form
Else
Exit Sub
End If

End Sub

i hope this makes sense
thanks

--
Message posted via http://www.accessmonster.com
Re: Doing stuff by Date
"Duane Hookom" <DuaneAtNoSpanHookomDotNet> 20.07.2006 03:26:31
Just a quick glance at your post finds an issue with your default " i put in
21/07/06 in the default value "
Try set the default to #21/07/06#

I'm not sure how this works on your side of whatever pond.

--
Duane Hookom
MS Access MVP

"Regan via AccessMonster.com" <u24090[ at ]uwe> wrote in message
news:638039b70eef3[ at ]uwe...
[Quoted Text]
> hi. In my startup form i have a textbox withthe control source =Date()
> [text27]. I have another textbox(unbound) [text29] where i want to put
> another date. What i want to do is when [text27] = [text29] then 'do some
> stuff' [text29] = [text27]. How do i put the a value in [text29] and keep
> it
> there?. i put in 21/07/06 in the default value and when i reload the form
> it
> comes up 30/12/1889. i haven't done programming but this is what i think i
> want to do
>
> Private Sub Form_Open(Cancel As Integer)
>
> Dim DNW As Date
> Dim DTD As Date
> Dim stdocname As String
>
> DTD = Text27.Value
> DNW = Text29.Value
> stdocname = "WageBal"
>
> If DNW = DTD Then
> Text29.Value = DTD + 7 ' and date stay there until it is reached
> again.
> its not satying there now
> DoCmd.OpenForm stdocname
> 'do some stuff and close form
> Else
> Exit Sub
> End If
>
> End Sub
>
> i hope this makes sense
> thanks
>
> --
> Message posted via http://www.accessmonster.com


Re: Doing stuff by Date
"Regan via AccessMonster.com" <u24090[ at ]uwe> 20.07.2006 04:04:09
yep put them in. cheers, but how do i put it in the code so that DTD + 7
comes our #21/07/06# instead of 21/07/06. How do i put the hashes in. th

Dim DNW As Date
Dim DTD As Date
Dim stdocname As String

DTD = Text27.Value
DNW = Text29.Value
stdocname = "WageBal"

If DNW = DTD Then
Text29.DefaultValue = DTD + 7 'i want hashes around this bit

DoCmd.OpenForm stdocname

Else
Exit Sub
End If

Thanks for help

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200607/1
Re: Doing stuff by Date
"Duane Hookom" <DuaneAtNoSpanHookomDotNet> 20.07.2006 04:52:10
Do yourself a favor and give your text boxes decent names. Your code is much
more maintainable. I also use "Me." in front of all form control names to
avoid confusion.

Me.Text29.DefaultValue = "#" & DateAdd("d",7,DTD) & "#" 'i want hashes
around this bit


--
Duane Hookom
MS Access MVP


"Regan via AccessMonster.com" <u24090[ at ]uwe> wrote in message
news:6382bbe899406[ at ]uwe...
[Quoted Text]
> yep put them in. cheers, but how do i put it in the code so that DTD + 7
> comes our #21/07/06# instead of 21/07/06. How do i put the hashes in. th
>
> Dim DNW As Date
> Dim DTD As Date
> Dim stdocname As String
>
> DTD = Text27.Value
> DNW = Text29.Value
> stdocname = "WageBal"
>
> If DNW = DTD Then
> Text29.DefaultValue = DTD + 7 'i want hashes around this bit
>
> DoCmd.OpenForm stdocname
>
> Else
> Exit Sub
> End If
>
> Thanks for help
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200607/1


Re: Doing stuff by Date
"Regan via AccessMonster.com" <u24090[ at ]uwe> 20.07.2006 05:29:23
Thanks Duane

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200607/1

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net