Hi,
i have a form "recherche" where a user can enter a search criteria (in a field 'Name' for instance)
For this field, on Lostfocus event, I have:
----------
docmd.openform "enqueteur",,"byname"
'byname is a requery...the research works fine
if Forms![enqueteur].Newrecord then
answer=MsgBox("No result.Create New Record?",vbyesno)
if answer=vbno then
Me.name.setfocus
else
'Here I want to add a new record but had an error whatever I tried :-(
end if
end if
-----------
I tried: - forms![enqueteur].filteron=false
docmd.gotorecord,,acnewrec
'error: can't go to specified record
- declaring database and recordset, then
rs.addnew
'I have no error but no record is created?!?!
- I checked: edits are allowed
- I didn't find a solution to my problem in other posts
All ideas are welcome, thanks in advance !!!
Jonath@Paris
i have a form "recherche" where a user can enter a search criteria (in a field 'Name' for instance)
For this field, on Lostfocus event, I have:
----------
docmd.openform "enqueteur",,"byname"
'byname is a requery...the research works fine
if Forms![enqueteur].Newrecord then
answer=MsgBox("No result.Create New Record?",vbyesno)
if answer=vbno then
Me.name.setfocus
else
'Here I want to add a new record but had an error whatever I tried :-(
end if
end if
-----------
I tried: - forms![enqueteur].filteron=false
docmd.gotorecord,,acnewrec
'error: can't go to specified record
- declaring database and recordset, then
rs.addnew
'I have no error but no record is created?!?!
- I checked: edits are allowed
- I didn't find a solution to my problem in other posts
All ideas are welcome, thanks in advance !!!
Jonath@Paris