Parse variable to function reports as mouse event [Solved] [closed]

asked 2019-07-06 05:42:40 +0100

LSemmens gravatar image

updated 2020-07-28 21:18:10 +0100

Alex Kemp gravatar image

I am attempting to call a subroutine as below. If I watch the variable "Number" in the OpenFormImage routine it reports as a mouse event The sub openMainImage is called by a "Mouse button released" event on a button in the main form. As there are several images on the main form I am attempting to make the OpenFormImage event as generic as possible hence the call to the subroutine. Begs the question. What am I doing wrong? The original Sub OpenFormImage before setting it up as a called routine works flawlessly. It is only, now that I attempting to validate the input from the calling routine that I run into strife.

Sub openMainImage
End Sub

Sub openVariantImage

Sub OpenFormImage(Number)
  Dim oForm     'Reference to the form containing the primary record.
  Dim oSubForm  'Reference to the subform containing the data
  REM Get the button's view model from the event Source.
  REM Get the button's data model from the view model.
  REM Get the form from the data model.
        oForm = ThisComponent.DrawPage.Forms.getByIndex(0)    ' Main Form
        oSubForm = oForm.GetByName("Stamp")              ' SubForm Name
  Dim sSG       
  Dim lSG
    REM Find the column that contains the NAME field.
 If Number = 3 then  
    lSG = oSubForm.findColumn("SM_VARIANT")
 Elseif Number= 2  then
    lSG = oSubForm.findColumn("SM_WATERMARK")
    lSG = oSubForm.findColumn("SM_IMAGE")   
 End If        
  REM Get the data for the current record.
    sSG = oSubForm.getString(lSG)  
    sSG = "/home/leigh/Documents/Stamps/" & sSG
 REM Open the window
    Shell "pix " & sSG

End Sub
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by ebot
close date 2019-07-06 10:18:50.476643


Ignore this, there was nothing wrong with it, I set the wrong click event on the button. My own fault.

LSemmens gravatar imageLSemmens ( 2019-07-06 06:06:32 +0100 )edit