|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Tell if subform record is new from main form.
How can I tell if a subform record is new using code on a parent form? I have a delete button on the parent. In the onclick event of the button I'd like to inform the user to select an existing subform record to delete if the user tries to delete a new subform record. However, for the life of me I can't figure out how to do it.
|
|
#2
|
|||
|
|||
|
How are you going to distinguish a new record from an old record?
S- |
|
#3
|
|||
|
|||
|
That's precisely the problem. I can't use the me.newrecord property because the form is a subform.
In the case of a continuous form I have that is based on a table, when a new record has the focus, I have: if me.newrecord = true then msgbox "Select an existing record to delete." else RunCommand acCmdDeleteRecord end if I'd like to do something similar a subform but with the delete button on the parent form. But, again, I need to be able to tell from the parent form module if the record in the subform is new or not. My apologies for any confusion. I hope this clarifies things. |
|
#4
|
|||
|
|||
|
Is there some kind of data in the subform record that distinguishs the new record from old records
For example Use of autonumber of Key, Latest umber will be the newest, or a date/Time field that captures the data and time the record was added. The you can use SQL to determine this information for you and code according to an "IF" statement. S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Tell if subform record is new from main form. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|