microsoft+access+course - attaching msgboxmacro parameter
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in
Home Course details Training formats Pricing FAQ Clients Book online Online schedule (live) Forum Contact us

Forum home » Delegate support and help forum » Microsoft Access Training and help » microsoft+access+course - Attaching a msgbox/macro to a parameter

microsoft+access+course - Attaching a msgbox/macro to a parameter

The UK's most regular instructor-led training courses.
Training information: microsoft+access+course · Microsoft access courses · Microsoft Access Training London
See also · microsoft access training · access vba courses · access database course

resolvedResolved · Low Priority · Version Standard

Attaching a msgbox/macro to a parameter

Shola has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Excel Intermediate course
Excel Advanced course
Excel VBA course
Excel Advanced course

by - delegate Shola [4 posts] (2007 Apr 24 Tue, 17:39) replyReply

Is it possible to attach a msgbox to a parameter?

I have created a parameter in a query and the query is linked to a form. It is a date parameter. However it still aloows the user to enter an invalid date e.g. 31/04/07. I would like to attach a macro to the parameter to prevent the user from entering such invalid dates, using msgboxs and macro control-actions

Access Intermediate 1 day course List price £225
Version Date Location Places
available
Book Next place rate:
Card Invoice
2003/XP 2008 May 27 Tue Bloomsbury 6 book now £193 £215
2003/XP 2008 Jun 3 Tue Southwark 6 book now £193 £215
2003/XP 2008 Jun 10 Tue Bloomsbury 7 book now £188 £215
2003/XP 2008 Jun 13 Fri Bayswater 8 book now £195 £205
2003/XP 2008 Jun 19 Thu Bloomsbury 6 book now £193 £215
2007 2008 Jun 24 Tue Bloomsbury 2 book now £224 £224
Full Schedule: See all 82 Access Intermediate course dates.
Bookings currently available until 24th November 2009.

RE: Attaching a msgbox/macro to a parameter

by - trainer Carlos gold contributer[311 posts] (2007 Apr 25 Wed, 12:12) Edited on 2007 Apr 25 Wed, 12:12 replyReply

Shola

To Verify the value of an entry before running the query do the following:

Create a form with a text box (For the date) And a Command Button

In the command button On Click command write code along these lines:

Private Sub cmdOK_Click()

If IsDate(txtDate.Value) = False Then

MsgBox "Please enter correct Date"
txtDate.SetFocus
Exit Sub
End If

DoCmd.OpenQuery "My Query"

End Sub

Then in the Query, in the criteria line for the date, use Build to set the query to look at txtDate on the form for the required value.

Regards

Carlos


Related articles

· Get More Out of MS Access Courses
· Quick MS Access Training: Creating Custom Database Tables in 12 Simple Steps
· Learn about Subqueries in Access Courses
· Quick Access Database Courses: A 10 Step Lesson in Encrypting and Decrypting an Access Database
· MS Access Top Tips: Takeaways From Microsoft Access Advanced Training

Access tip:

Deleting duplicate records from a table

You cannot delete records tables where there duplicate records. A way around this is to create a new table which wont hold the duplicates. and then deleting the old table.

1. Use a make-table query based on this table only. IMPORTANT - Ensure that you include all of the fields from your original table or you may loose data.

2. Open the query's property sheet by using VIEW, QUERY, PROPERTIES, and set the Unique Values property to Yes

3. Because you have selected the Unique Values to Yes when you run the query, Access creates a new table without duplicate records. You can now delete the old table and rename the new one.

View all Access hints and tips

Institute of IT Training - Accredited Training Provider Institute of IT Training - Accredited Training Provider Prodigy Platinum Learning Partner Microsoft Office Specialist Authorised Testing Centre

Microsoft Registered Partner
microsoft office
ms office project server

Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information