98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access VBA Training and help » Short cut to updating multiple field properties | Access forum
Short cut to updating multiple field properties | Access forum
Resolved · Urgent Priority · Version 2003
Gillian has attended:
Access VBA course
Excel Advanced course
Short cut to updating multiple field properties
Hi,
I am updating fields in a table recorset. Is there a quicker way to update multiple fields in a recordset in the same way e.g. Trim them all rather than code it individually for each field?
Conversely is there a quicker way to do lots of things to one (or many) field rather than code it individually e.g. for a field I want to trim it, do a few find and replaces, set to lower case etc?
Thanks.
RE: short cut to updating multiple field properties
Hi Gillian
If you need to tidy up every field in a similar way you could shorten your code and write a function to use on each field.
For Example
Function TidyUp(stOrigValue)
TidyUp = Trim(stOrigValue)
TidyUp = LCase(TidyUp)
End Function
and then when processing your fields
With rsMyTable
.fields("UserName")=TidyUp(.fields("UserName")
...
.Update
End With
Hope that helps
Laura
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Using the Quick Access Toolbar in Access 2010The Quick Access Toolbar is included in virtually every Office product, including Outlook 2010, Word 2010, Excel 2010, and PowerPoint 2010. |