by rvguy » Tue Jan 06, 2015 11:17 pm
Hello MTP,
I was trying a few different statements, and still no-go. Here is what I think I need to do ... basically get one thing working at a time. And I apologize in advance for being so inept at this OO Base stuff. It will come to me, as I've been doing programming for many many years. But sometimes some things take a bit longer than others. So I also thank you in advance for your patience.
As I said, I can get the assets detail form to open when I click on the InventoryID field in the DataSheet view, so I do believe we are very close. I think the next step is to be able to retrieve the InventoryID from the selected record in the summary form and save it in a variable. Then we can use that variable to open up the asset detail form showing the selected record.
Initially, I am having problems getting the InventoryID variable. I thought it would be a good idea to do what you suggested and find out more about my forms. Yes, they were created using the wizard. When I open up the forms in Design mode, I see two "navigator" icons. One is in the right-hand column and looks like a compass. It doesn't really look like a rectangle, however. When i click that icon, all it does is open up a window with these items in it:
Headings
Tables
Text Frames
Graphics
etc. etc.
Comments
Draw Objects
When I click on any of these lines, all I get is "0 Headings", "0 Tables", etc. so I don't think this is the icon you were referring to. The other icon is on the bottom of the screen. It says "Form Navigator" when I mouse-over. It looks like a document with some round graphic in the upper-right-hand corner of the icon (can't make out what that graphic is). I think this is probably the function you wanted me to use.
When I click it, it brings up a small pop-up box. The box contains this:
Forms
.... MainForm
........lblInventoryId
........fmtInventoryID
........lblManufacturer
........txtManufacturer
etc. for all the fields in the table.
Also, in viewing the Controls for the assets table, InventoryID is shown for both the Field Name and Label on the General tab and Data field on the Data tab.
So, in trying to first being able to get the InventoryID, I have tried all these statements and none work:
i = oMainDocForm.columns.InventoryID.getInt ... Error is "Object variable not set"
i = oMainDocForm.columns.fmtInventoryID.getInt ... Error is "Object variable not set"
i = oMainDocForm.TableGridName.InventoryID.CurrentValue ... Error is "Object variable not set"
i = oMainDocForm.TableGridName.fmtInventoryID.CurrentValue ... Error is "Object variable not set"
Just FYI - I have also tried it with these statement included for all tests (which were inserted before the above statements):
Dim i
Dim I as object
Any thoughts? And again, thank you.
-rvguy
OpenOffice 4.1.1 on Windows XP