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

Automatic new record in a form

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


Joined: 21 Nov 2006
Posts: 28

PostPosted: Tue Feb 27, 2007 4:11 pm    Post subject: Automatic new record in a form Reply with quote

Hi,

I'm trying to have a macro enter a new record into a form table and complete the record. I have tried updateRow() opttion but gives me an error (last line):

oForm.moveToInsertRow()
oForm.UpdateString(PartNoCol,sBarCode)
oForm.UpdateString(RevisionCol,RevCode)
oForm.updateRow()

What is the correct command here? Also, is there good reference for all the commands/methods?

thanks,
Back to top
View user's profile Send private message
mobi-doc
OOo Enthusiast
OOo Enthusiast


Joined: 30 Jan 2007
Posts: 130
Location: Thessaloniki

PostPosted: Wed Feb 28, 2007 2:13 am    Post subject: Reply with quote

UpdateRow doesn't work with new records. You must save it first. This is the code I use when I want to save or update a row before do something else with the form:
Code:

     oF=ThisComponent.DrawPage.Forms(0)
   if oF.isNew=True then
      oF.insertRow()
   else
      oF.updateRow()
   end if
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rancor
General User
General User


Joined: 21 Nov 2006
Posts: 28

PostPosted: Wed Feb 28, 2007 4:01 am    Post subject: Reply with quote

That worked thanks!
Back to top
View user's profile Send private message
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