|
Ok, I created a table named contacts and one named cities. Then a form
named contacts. The contacts table has a field named 'city' and on the form I put a combo box that lists the recrods from the cities table and writes the value to contacts.city. You know before I write this next line I have to say, the use of the word form is damned confusing here. In the database 'form' contacts (this is a writer document) is the 'form' MainForm (this is the embedded rowset object), on this MainForm in the event "After record change" i call this macro Sub UpadteCities dim oConn as Object dim oStmt as Object dim ORows as Object dim cMainForm as Object oMainForm = thisComponent.Drawpage.forms.getByName( "MainForm" ) oConn = oMainForm.ActiveConnection oStmt = oConn.CreateStatement ' Check if the text in the city combo box is already in the cities table oRows = oStmt.ExecuteQuery( "select * from ""cities"" where ""city"" = " _ + "'" + oMainForm.ComboBox1.text + "'") oRows.next if oRows.Row = 0 then ' if it is not in the cities table ' add it oStmt.ExecuteUpdate( "insert into ""cities"" Values( " _ + "'" + oMainForm.ComboBox1.text + "')") endif End Sub Now, this is just a start..and I am sorry it is more then 4 lines long...but it should show you everthing you need. (oh the idea about the button before...what can I say...wrong) HTH Andrew [EMAIL PROTECTED] wrote: On 9 Aug 2005 at 20:45, Andrew Jensen wrote: |
- [dba-users] Drop down list in form garyw
- Re: [dba-users] Drop down list in form Andrew Jensen
- Re: [dba-users] Drop down list in form Alex Thurgood
- Re: [dba-users] Drop down list in form Andrew Jensen
- Re: [dba-users] Drop down list in form Alex Thurgood
- Re: [dba-users] Drop down list in form garyw
- Re: [dba-users] Drop down list in form Andrew Jensen
