PC Review


Reply
Thread Tools Rate Thread

Using Macros to require data entry

 
 
=?Utf-8?B?Q2hp?=
Guest
Posts: n/a
 
      13th Apr 2006
Hi,
I would like to set up a macro to require data entry.

I have a form that has Main form and sub form.

One of the fields that located on the main form is CALL (yes/No type)

One of the fields located in the subform is CALLDATE field. It is wonderful
if soon I check CALL field located main form, it will pop up the message "
please enter CALLDATE field in subform".

If I don't check CAll field in the main form, no message pop up
Please help

Thanks
Chi
 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZnJlYWthemV1ZA==?=
Guest
Posts: n/a
 
      14th Apr 2006
Hi,
try to adapt VBA (visual basic for applications). Macros are very limited
and cannot handle error handling.
Try this on the on click event or after update event of the checkbox in your
main form:

If Me.YourCheckBox = True Then
MsgBox("Please enter a value in CALLDATE")
Me!SubformName.Form.ControlName.SetFocus
End If

HTH
Good luck

--
Oliver
Admin Specialist & Computer Science Major @ UMD - Go Terps -
http://www.oli-s.de


"Chi" wrote:

> Hi,
> I would like to set up a macro to require data entry.
>
> I have a form that has Main form and sub form.
>
> One of the fields that located on the main form is CALL (yes/No type)
>
> One of the fields located in the subform is CALLDATE field. It is wonderful
> if soon I check CALL field located main form, it will pop up the message "
> please enter CALLDATE field in subform".
>
> If I don't check CAll field in the main form, no message pop up
> Please help
>
> Thanks
> Chi

 
Reply With Quote
 
 
 
 
Ken Snell \(MVP\)
Guest
Posts: n/a
 
      14th Apr 2006
This can be done using a Condition expression with the macro action of
MsgBox and then the action StopMacro. I am assuming that CALLDATE is a
control on the subform (a field is in a table, in a query, or in a form's
recordset; a control is on a form or a report).

Macro:
Condition: Len(Forms!FormName!SubformName!CALLDATE & "")=0
Action: MsgBox
Message: "Enter value in CALLDATE!"

Condition: ... (note: put three dots in the box)
Action: StopMacro

Note that FormName in the above expression is the name of the main form, and
SubformName is the name of the subform control (the control that actually
holds the subform object).

--

Ken Snell
<MS ACCESS MVP>

"Chi" <(E-Mail Removed)> wrote in message
news:41B9ACCC-1A1B-423C-8B0E-(E-Mail Removed)...
> Hi,
> I would like to set up a macro to require data entry.
>
> I have a form that has Main form and sub form.
>
> One of the fields that located on the main form is CALL (yes/No type)
>
> One of the fields located in the subform is CALLDATE field. It is
> wonderful
> if soon I check CALL field located main form, it will pop up the message "
> please enter CALLDATE field in subform".
>
> If I don't check CAll field in the main form, no message pop up
> Please help
>
> Thanks
> Chi



 
Reply With Quote
 
=?Utf-8?B?Q2hp?=
Guest
Posts: n/a
 
      14th Apr 2006
It works ! Thank you so much!

"freakazeud" wrote:

> Hi,
> try to adapt VBA (visual basic for applications). Macros are very limited
> and cannot handle error handling.
> Try this on the on click event or after update event of the checkbox in your
> main form:
>
> If Me.YourCheckBox = True Then
> MsgBox("Please enter a value in CALLDATE")
> Me!SubformName.Form.ControlName.SetFocus
> End If
>
> HTH
> Good luck
>
> --
> Oliver
> Admin Specialist & Computer Science Major @ UMD - Go Terps -
> http://www.oli-s.de
>
>
> "Chi" wrote:
>
> > Hi,
> > I would like to set up a macro to require data entry.
> >
> > I have a form that has Main form and sub form.
> >
> > One of the fields that located on the main form is CALL (yes/No type)
> >
> > One of the fields located in the subform is CALLDATE field. It is wonderful
> > if soon I check CALL field located main form, it will pop up the message "
> > please enter CALLDATE field in subform".
> >
> > If I don't check CAll field in the main form, no message pop up
> > Please help
> >
> > Thanks
> > Chi

 
Reply With Quote
 
=?Utf-8?B?Q2hp?=
Guest
Posts: n/a
 
      14th Apr 2006
Hi Ken Snell,

Thank you for giving me another way to try.
Chi

"Ken Snell (MVP)" wrote:

> This can be done using a Condition expression with the macro action of
> MsgBox and then the action StopMacro. I am assuming that CALLDATE is a
> control on the subform (a field is in a table, in a query, or in a form's
> recordset; a control is on a form or a report).
>
> Macro:
> Condition: Len(Forms!FormName!SubformName!CALLDATE & "")=0
> Action: MsgBox
> Message: "Enter value in CALLDATE!"
>
> Condition: ... (note: put three dots in the box)
> Action: StopMacro
>
> Note that FormName in the above expression is the name of the main form, and
> SubformName is the name of the subform control (the control that actually
> holds the subform object).
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
>
> "Chi" <(E-Mail Removed)> wrote in message
> news:41B9ACCC-1A1B-423C-8B0E-(E-Mail Removed)...
> > Hi,
> > I would like to set up a macro to require data entry.
> >
> > I have a form that has Main form and sub form.
> >
> > One of the fields that located on the main form is CALL (yes/No type)
> >
> > One of the fields located in the subform is CALLDATE field. It is
> > wonderful
> > if soon I check CALL field located main form, it will pop up the message "
> > please enter CALLDATE field in subform".
> >
> > If I don't check CAll field in the main form, no message pop up
> > Please help
> >
> > Thanks
> > Chi

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Require Field Entry based On Other Entry PPCO Microsoft Access 2 1st Dec 2009 05:12 PM
Online Data Entry, Offline Data Entry with Data Entry Services James Roy Microsoft Access Forms 1 3rd Feb 2009 01:45 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Excel Misc 0 20th Mar 2008 01:45 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Access Form Coding 0 20th Mar 2008 01:44 PM
Emails that require follow-up often require a task. =?Utf-8?B?RGFuNjBoZXI=?= Microsoft Outlook Discussion 1 27th Jun 2006 02:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:06 PM.