Results 1 to 2 of 2
Thread: Using a module (a2k)
2001-09-11, 05:34 #1HeywoodJablowmeGuest
Using a module (a2k)
Hi, I am a complete nerd when it comes to Acces but I am trying to learn as I go along.
I copied the following module as a new module but I cannot get it to work (its supposed to change text to proper case). When I set up a new table do I have to tell it where to look for the module or should it automatically know because I have made sure that my table and field are the same as mentioned in the module.
Option Compare Database
On Error GoTo Err1
Dim SQL As String, Rs As DAO.Recordset, Db As DAO.Database
Set Db = CurrentDb()
SQL = "SELECT[tblCustomer].*FROM[tblCustomer]"
Set Rs = Db.OpenRecordset(SQL, dbOpenDynaset)
Do Until Rs.EOF
Rs![CustomerName] = StrConv(Rs![CustomerName], vbProperCase)
MsgBox "Done!", vbInformation, "Proper case!"
MsgBox Err.Number & "" & Err.Description, vbInformation, "Proper case error..."
I used the debug, compile feature which reported no errors.
Any help would be very nice indeed, thank you
2001-09-11, 08:08 #2
- Join Date
- Feb 2001
- Sint Niklaas, Belgium
- Thanked 0 Times in 0 Posts
Re: Using a module (a2k)
If you want to run the function once, open it in Design mode, put the cursor anywhere in the code and press F5.
If you want to run it on regular base, then there are different possibilities.
You can put a command button on a form and copy the code in the on click event of this button.
If you use a switchboard, then you can run the code from a switchboard optionFrancois