Ask Your Question

kmihalj's profile - activity

2018-06-10 21:20:40 +0200 received badge  Taxonomist
2014-09-29 20:05:45 +0200 received badge  Notable Question (source)
2014-09-29 20:05:45 +0200 received badge  Famous Question (source)
2014-05-04 15:23:30 +0200 received badge  Popular Question (source)
2014-04-24 01:17:06 +0200 received badge  Editor (source)
2014-04-24 01:16:03 +0200 asked a question Macro to open another form with selected data, or to create new data if "filtered" if not existing ...

I use macros from example in this post from file Open_Form_Filtered.odb, .... but...

What if I don't have filtered record in other form (no relation data created) .... I need macro to open filtered data in another form or to create new record if data is not existend ... well I can add data to opened form, but trouble is listbox in which if I select data (for new record) I get error, and nothing is entered (unless I disable macro for listbox)

So in short, error in on new record in listbox ...

Now I use this...

Sub Otvori_Upisni_List_iz_Maticnog_Lista (oEvent As Object) 'This opens another form with filtered data
    oForm = oEvent.Source.Model.Parent
    oForm2 = ThisDatabaseDocument.FormDocuments.getByName("Upisni") 
    oForm3 = oForm2.Component.DrawPage.Forms.getByName("Upisni_List")
    oForm3.Filter="( ""UPISNI_LIST"".""FK_Maticni"" = " & iID & " )" 
end sub

Sub Refresh_MainForm (oEvent As Object) 'List Box > Execute (event)
   oForm = oEvent.Source.Model.Parent 
   oForm.updateRow() 'this is point where I get error when entering data to new record via listbox, ... changing data on existing records works fine
End Sub