Hello,
I am trying to use a combo box to display a record. I think I need to add a macro into the After updating field.
I can't find a macro for this. Is there one available for this?
In MS Access I can do this by using this bit of code.
Private Sub Combo2_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Song_Name] = '" & Me![Combo2] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Thanks for your help!
Selecting a record with a combo box.
Re: Selecting a record with a combo box.
Sorry I don't have the answer for you, I'm still trying to learn it myself. New job where I don't use DBs regularly really puts a crimp in learning new DBs.
Try
http://toolkit.its.isu.edu/Documentatio ... _en-US.PDF
Try
http://toolkit.its.isu.edu/Documentatio ... _en-US.PDF
Ron from Iowa, USA
Re: Selecting a record with a combo box.
Hi,geleugim wrote:Hello,
I am trying to use a combo box to display a record. I think I need to add a macro into the After updating field.
I can't find a macro for this. Is there one available for this?
Errmm, how about reloading the form ? You can do this programmatically with form.reload()
Alex
Re: Selecting a record with a combo box.
If you mean that you want to use a combo box to select or search for a particular record, you might find this thread from the OpenOffice.org Forum helpful.
Here's the macro I ended up using:
But reading the full thread there will give you more background.
There is also this tutorial written for NeoOffice. Since NeoOffice is based on OpenOffice.org, the instructions should work fine for OpenOffice.org, if you keep the following things in mind:
1) references to the command key in a Neo tutorial are the equivalent to the control key in OOo. (i.e. Command-C becomes Control-C) Note that I'm not sure if this is true with OOo for X11.
2) control-clicking is the same as right clicking
3) icons sometimes look different, as NeoOffice 2.2.2 has a custom icon set.
I should also note, though, that this article I linked to is part of a longer tutorial, and some people may find it difficult to drop into the middle of the series and make sense of the table and field names, etc.
kabing
Here's the macro I ended up using:
Code: Select all
Sub SearchByStateOrProvince
dim oFilter as object
dim oFormCtl as object
oFormCtl = ThisComponent.Drawpage.Forms.getByName("Standard")
oFilter = oFormCtl.getByName("StateSearchListBox")
if oFilter.CurrentValue <> "" then
oFormCtl.Filter = "State LIKE " + "'"+oFilter.CurrentValue+"'"
oFormCtl.ApplyFilter = True
else
oFormCtl.ApplyFilter = False
end if
oFormCtl.Reload
End Sub
There is also this tutorial written for NeoOffice. Since NeoOffice is based on OpenOffice.org, the instructions should work fine for OpenOffice.org, if you keep the following things in mind:
1) references to the command key in a Neo tutorial are the equivalent to the control key in OOo. (i.e. Command-C becomes Control-C) Note that I'm not sure if this is true with OOo for X11.
2) control-clicking is the same as right clicking
3) icons sometimes look different, as NeoOffice 2.2.2 has a custom icon set.
I should also note, though, that this article I linked to is part of a longer tutorial, and some people may find it difficult to drop into the middle of the series and make sense of the table and field names, etc.
kabing
NeoOffice (app store version) OpenOffice.org 4.1 and LibreOffice 4.3 on Mac OS X El Capitan
OpenOffice.org 4.1.2 on Windows 10 (Previously on Vista)
OpenOffice.org 4.1.2 on Windows 10 (Previously on Vista)