| View previous topic :: View next topic |
| Author |
Message |
rancor General User

Joined: 21 Nov 2006 Posts: 28
|
Posted: Tue Feb 27, 2007 4:11 pm Post subject: Automatic new record in a form |
|
|
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 |
|
 |
mobi-doc OOo Enthusiast


Joined: 30 Jan 2007 Posts: 130 Location: Thessaloniki
|
Posted: Wed Feb 28, 2007 2:13 am Post subject: |
|
|
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 |
|
 |
rancor General User

Joined: 21 Nov 2006 Posts: 28
|
Posted: Wed Feb 28, 2007 4:01 am Post subject: |
|
|
| That worked thanks! |
|
| Back to top |
|
 |
|