Jumat, 26 April 2013

RE: [MS_AccessPros] Auto fill control through button click

 

John,

Thank you very much..

I thought my first line code will set me within the subform and that I can
just use "Me".

Me.sbfDocdetail.SetFocus

Thank you once again,

zjubias

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Viescas
Sent: Friday, April 26, 2013 5:13 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: RE: [MS_AccessPros] Auto fill control through button click

Zjubias-

Replace:

Me.DDate = Date

With:

Me.sbfDocdetail.Form!DDate = Date

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

__________________________________
From: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
[mailto:MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of moi
Sent: Friday, April 26, 2013 3:34 PM
To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: [MS_AccessPros] Auto fill control through button click

Hello all,

Am trying to auto fill my DDate control through a button click.

The code behind the button is below.

Can some correct my code please.. the control i wanted to fill is on the
subform as indicated with the first line of code.

Please bear with me, am trying to learn how to code..

Thank you,
zjubias

Private Sub cmdAddDetail_Click()
On Error GoTo Err_cmdAddDetail_Click

Me.sbfDocdetail.SetFocus
DoCmd.GoToRecord , , acNewRec
Me.DDate = Date

Exit_cmdAddDetail_Click:
Exit Sub

Err_cmdAddDetail_Click:
MsgBox Err.Description
Resume Exit_cmdAddDetail_Click

End Sub

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
MARKETPLACE


.

__,_._,___

Tidak ada komentar:

Posting Komentar