Office Systems Developer

Joao Livio (Portugal)

Sample Function to Translate a Access Database IDE (ADODB)

Just an idea to support multilanguage IDE in a Access Database, what i do? i create a Table with the FORM NAME, CONTROL NAME and LANGUAGE, i am selectin the Language and comparing the Control Name with the Table Description, if you want you can ByVal the strLanguage = “pt-PT”, here it is my Function

Option Compare Database Public Function yTranslaction(ByVal strFORM As String, _ ByVal frmFORM As Form) Dim cnn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim strSQL As String Dim ctlCONTROL As Control On Error GoTo erro strLanguage = “pt-PT” strSQL =SELECT * FROM y_TRANSLACTIONS ” & _ “WHERE LANGUAGE =’” & strLanguage & “‘” &AND FORM=’” & strFORM & “‘” cnn.ConnectionString = CurrentProject.Connection cnn.Open rs.Open strSQL, cnn, adOpenKeyset, adLockOptimistic Set frmFORM = Forms(strFORM) With rs Debug.Print .RecordCount Do Until rs.EOF = True For Each ctlCONTROL In frmFORM.Controls If TypeOf ctlCONTROL Is Label Then If ctlCONTROL.Name = rs.Fields(”CONTROL”).Value Then ctlCONTROL.Caption = rs.Fields(”CAPTION”).Value End If End If If TypeOf ctlCONTROL Is CommandButton Then If ctlCONTROL.Name = rs.Fields(”CONTROL”).Value Then ctlCONTROL.Caption = rs.Fields(”CAPTION”).Value End If End If Next .MoveNext Loop End With cnn.Close Set rs = Nothing Exit Function erro: MsgBox Err.Number &-& Err.Description, vbOKOnly + vbExclamation, "Erro na Rotina” End Function

Comments

predictive dialing software said:

CRM Solutions improve customer relationships by automating & managing call center calls using Telescript. Predictive dialer and telemarketing software ...do a lot of the same thing.

# July 13, 2009 11:33 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)