I'm trying to understand how basic works with API and UNO.
Found some documentation about basic, but I really get lost with API and UNO.
My purpose is this one, so simple:
MySQL database with just one table: tbCustomers, with name, phone and address.
Then a OpenOffice base application connected with the MySQL database.
Done.
But now my purpose is:
Form connected with the only one table tbCustomers in the MySQL database.
It works, and I can see and modify data.
No need for basic macros, so far.
Now I want to make it harder. I add two text fields, not connected. One named txtPhone, other named txtAddr
When the user starts typing into one txt field, no matter what, the "modified" event should trigger a basic function that will compile a SQL string to filter records of the tbCustomers table in the form
I did it quite easy using msAccess. This was the working code:
Code: Select all
'
' This sub makes a search in the customers table for a phone number
' that contains the digits that the user inserts as a pre-selection
' into the text box TxNumTel
'
Private Sub TxNumTel_Change()
Dim TelNumParz As String ' partial phone number
Dim SQL_query As String ' SQL quuery string
TelNumParz = Me.TxNumTel.Text ' Partial phone number from the TxNumTel text box
'
' If the partial phone number is not empty
' I prepare a SQL query string
' and I will assign it to the listbox RpRicercaElencoClienti
' then I start a requery
'
If Not IsNull(TelNumParz) Then
SQL_query = " Select ID,Nominativo,Indirizzo,Telefono,Note " & _
"from Clienti where (Telefono like " & Chr$(34) & "*" & TelNumParz & "*" & Chr$(34) & ");"
Me.RpRicercaElencoClienti.RowSource = SQL_query
Me.RpRicercaElencoClienti.Requery
End If
End Sub
The main problem is that I can't understand how to get my information from the API/UNO documentation. I get lost.
Any hint?
Thanks a lot