Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for new record in subform

Status
Not open for further replies.

apestaart

Technical User
Feb 5, 2004
107
NL
Hi,
I have a form called "frmworkingours" with a subform "subOurs". I want to check if the user adds a new record. I know that I can check on "frm.NewRecord"
But I can´t find a way to declare frm as the subform above.
Who can help me?
Recards Apestaart
 
When the focus is in the mainform you can't have a subform with a newrecord (IMO)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hallo PVH,
In the subform I have a combobox for choosing a new month as first field in a new record. With the after update event I want to see if this a new record.
Hope this helps in understanding what I try to do.
Regards,
Apestaart
 
What about dlookup?

i.e.,

checkString = me.comboMonth.value & otherValue

if isNull(dlookup("[Record]", "tblValues", "[Record] = 'checkString'")) = True then

'add the record since dlookup returns null

else

'warn user that the record value already exists

end if


Avaya 8720\Octel VMX300
"Sanity is a goal, not a guarentee"
 
Oops. messed up in the dlookup. corrected version:

checkString = me.comboMonth.value & otherValue

if isNull(dlookup("[Record]", "tblValues", "[Record] = '" & checkString & "'")) = True then

'add the record since dlookup returns null

else

'warn user that the record value already exists

end if


Avaya 8720\Octel VMX300
"Sanity is a goal, not a guarentee"
 
Hi,
What do you mean with "& otherValue"?
Apestaart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top