Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 2nd, 2004, 08:16 AM
dwc dwc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 dwc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 20 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old February 2nd, 2004, 10:19 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
How are you going to distinguish a new record from an old record?

S-

Reply With Quote
  #3  
Old February 2nd, 2004, 11:05 AM
dwc dwc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 dwc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 20 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old February 2nd, 2004, 11:42 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
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-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Tell if subform record is new from main form.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway