microsoft training access course - procedures
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

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » microsoft training access course - Procedures

microsoft training access course - Procedures

The UK's most regular instructor-led training courses.
Training information: microsoft training access course · Access course microsoft training · VBA training UK

resolvedResolved · Low Priority · Version Standard

Procedures

Gerry has attended:
Access VBA course

by - delegate Gerry [1 post] (2007 Sep 18 Tue, 07:24) replyReply

On a form I have some code behind the 'on update' event procedure to change the case format of the entered text. The field is DoctName

if not isnull(DocName) then
DocName = Strconv(DocName,vbProperCase)
end if

I want to put this code behind other fields on the form but of course with the correct field name. Can I create a procedure and then call the procedure from the 'on update' for each relevant field on the form. If so how can I refer to the field name (which will of course change) in the procedure.

Access VBA 2 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2003 2008 Oct 20 Mon + 21 Tue Southwark 5 book now £450 £485
2003 2008 Nov 6 Thu + 7 Fri Southwark 6 book now £450 £485
2003 2008 Dec 4 Thu + 5 Fri Southwark 7 book now £345 £399
2003 2009 Jan 8 Thu + 9 Fri Southwark 7 book now £345 £399
2003 2009 Feb 5 Thu + 6 Fri Southwark 8 book now £275 £399
2003 2009 Mar 5 Thu + 6 Fri Southwark 8 book now £275 £399
Full Schedule: See all 14 Access VBA course dates.
Bookings currently available until 5th November 2009.

RE: Procedures

by - delegate Jo [2 posts] (2007 Sep 18 Tue, 13:44) replyReply

Yes you can by creating a procedure for instance


but may I suggest in the interest of simplicity you use the

ucase function

me.docname = UCase(me.docname.value)
just change the field name as appropriat e
if null is passed no error occurs - null is returned thus eliminating a needless check



ALTERNATIVELY SHOULD YOU WISH A GENERIC PIECE OF CODE
code
sub ChangeToU_Case( frmName as string , txtBoxName as string)


forms!frmname!txtBoxName.value = ucase(forms!frmname!txtBoxName.value)
forms!frmname.refresh
end sub
/code
CONTINUE.......
----------------------

on each of the after update EVENTS OF YOUR FIELDS
ChangeToU_Case(me.name & " " & Me.Text0.Name)

Replace the Text0 with the names of the fields on which you wish to implement the code

**********************************************
NB *****
CHECK BEFORE RUNNING AS I AM IN 2007 AND THINGS HAVE CHANGED MIGHTILY

jO


Related articles

· Reasons to Consider Microsoft Access Training
· Tips for designing databases in Microsoft Access
· Want to Become the Office Hero? MS Project Training Could be the Answer
· Microsoft Access Cheat Sheet: Tips and Shortcuts
· Quick MS Access Training: Creating Custom Database Tables in 12 Simple Steps

Access tip:

Display current date & time in column of any width

The worksheet function =NOW() returns the current date & time. When entered into a column which is not wide enough to display the value NOW returns, the cell displays ###’s.

You could widen the column to make the date and time show, but sometimes this is not convenient: the column may already be exactly the width you want to accommodate all entries in cells further below. Maybe you don’t want to push any other columns any further to the right, because you won’t be able to see the column contents on one screen, or because it forces you to change the print settings.

The solution is to use the TEXT function to convert the value returned by NOW to text: text (as opposed to a value) stretches into the next column rather than returning ###’s. The TEXT function has two arguments: 1. the value to convert to text; 2. what format to show it in. Use custom number codes in double quote marks to specify the format. For example =TEXT(NOW(),”ddd dd/mm/yy hh:mm”) will return date and time using the format FRI 09/04/04 11:24.

View all Access hints and tips

Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider 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
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz