OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

What does "BASIC runtime error: Arguement is not option

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
TiredTurk
General User
General User


Joined: 03 Aug 2007
Posts: 24
Location: Ankara, Turkey

PostPosted: Thu Sep 20, 2007 8:46 am    Post subject: What does "BASIC runtime error: Arguement is not option Reply with quote

mean? I have been attempting to teach myself macro programming using Andrew and Quazzie Evil'sdocuments. To see an example of a working macro code, I tried running this code (swiped from Andrew's DB doc)
Code:

Sub ButtonCall(oEvent)
  Dim i
  Dim oButton
  Dim oModel
  Dim oShape
  Dim bFound As boolean

  REM First, get the button used to call this routine.
  REM Save the button's model.
  oButton = oEvent.Source
  oModel = oButton.getModel()

  REM Iterate through the controls
  i = ThisComponent.getDrawPage().getCount()
  bFound = False
  Do While (i > 0 AND NOT bFound)
    i = i - 1
    oShape = ThisComponent.getDrawPage().getByIndex(i)
    bFound = EqualUNOObjects(oShape.Control, oModel)
  Loop
  If bFound Then
    Print "The button is in cell " & oShape.getAnchor().Cell.CellName
  End If
End Sub


But get the "Arguement is not optional error on
Code:
oButton = oEvent.Source


Using this code from QE
Code:

Sub BeforeRecordAction(event As Object)
Dim Form As Object
Dim Control As Object
Form=Event.Source.Model
Control=Form.getByName("laboratuvar")
MsgBox "Hi!" & Control.Text
End Sub

I am getting the same error message on
Code:
Form=Event.Source.Model


What kinds of errors cause that message? And more importantly, how do you fix them?

Thank you
Back to top
View user's profile Send private message
QuazzieEvil
Super User
Super User


Joined: 17 Jan 2007
Posts: 599
Location: Houston, TX

PostPosted: Thu Sep 20, 2007 9:11 am    Post subject: Reply with quote

how are you calling the function? seems you are not passing the parameter 'Event'
Back to top
View user's profile Send private message Visit poster's website
TiredTurk
General User
General User


Joined: 03 Aug 2007
Posts: 24
Location: Ankara, Turkey

PostPosted: Thu Sep 20, 2007 11:26 am    Post subject: Re: Arguement error Reply with quote

Usually just by yelling at it...(sorry I'm bit punchy right now)

When you call a function it looks something like this doesn't it?
Code:


Sub BeforeRecordAction_laboratuvar_INSERT(event As Object)
........
Dim IsimNe As String
IsimNe="com.sun.star.comp.forms.ODatabaseForm"
........
End Sub


If it doesn't, then I have no idea how I am calling the function Embarassed
Back to top
View user's profile Send private message
QuazzieEvil
Super User
Super User


Joined: 17 Jan 2007
Posts: 599
Location: Houston, TX

PostPosted: Thu Sep 20, 2007 11:40 am    Post subject: Reply with quote

no, that is the function definition.

a function call refers to the execution

for example:

BeforeRecordAction_laboratuvar_INSERT(event)

here I am calling it and passing a parameter named event.

what you need to do is to find that code (the function definition) to some event--in this case the 'Before Record Action' event of a form. when you do that, the 'event' parameter is passed automatically for you.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group