Typo3 Developer: MS Access Tutorial - 5
Create a button to update the new usergroups-list to Typo3 from MS Access.
Draw another rectangle and color it for the third step in the usergroup management section of our form.
Place another Command button in this new shape. Cancel the wizard.
Right-click to view the button's properties. Name the button "UpdateUsergroups". Set the Caption to "Update Usergroups". Set the On Click to "Event Procedure". Click the VB Editor button to view the code.
When the button is clicked, we want it to submit the contents of the UsergroupList textbox to the fe_users:usergroup field in our Typo3 website. We can accomplish this with the following two functions.
Function 1. UpdateUGroups.
Function 2. UpdateUsergroups_Click: Calls the UpdateUGroups function.
Copy the following code and paste it over the UpdateUsergroups_Click starter function.
Public Function UpdateUGroups()
' updates website OLE field usergroup with new list of user groups
Dim MyVar
Dim con As ADODB.Connection 'connect using ADO and MySqlPov'which are both OLE-friendly
Set con = New ADODB.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
con.Open "Provider=MySqlProv;Data Source=typo3db_sitedb;Password=******;User ID=typo3db_access;Location=NN.NN.NN.NN"
rs.Open "UPDATE fe_users SET usergroup = ('" &[UsergroupList] & "') WHERE (((fe_users.uid)=" &[uid] & "));", conMsgBox "Website updated to " & [UsergroupList]
[UsergroupList].SetFocus
[UsergroupList] = ""
UpdateUsergroups.Enabled = FalseAvailableUsergroups.Requery 'This will reset the list box
AvailableUsergroups.Enabled = FalseEnd Function
Private Sub UpdateUsergroups_Click()
' calls the UpdateUGroups function when UpdateUsergroups
' btn is clicked
On Error GoTo Err_UpdateUsergroups_Click
Call UpdateUGroups
Exit_UpdateUsergroups_Click:
Exit Sub
Err_UpdateUsergroups_Click:
MsgBox Err.Description
Resume Exit_UpdateUsergroups_Click
End Sub
Add a label with some instructions and this part of our form should look like this:
![]() |
The final form should look like this (click to enlarge).

