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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

complete record before allowing new 1

Status
Not open for further replies.

jailerg013

Technical User
Nov 19, 2003
16
US
I have a form which stores data on a date, start time, & end time of an event. I need to save the record without the end time until I can update that field at whatever time the event ends, but I do not want to allow a new record be added until the previous record is complete. Is this Possible? (Everything I get to work only works with events that have previous records. When I create a new event and attempt to add a time record it creates an error.) Please Help!
 
Jailer,

Yes, you can do this. You'll have to make sure that data entry only happens through forms and never tables, which is standard practice anyway.

Write a sub to check if all of the fields are complete. If they aren't, set the "Allow Additions" property of your form to false. If they are, set it to true.

Call this sub from the OnCurrent event of your form and the after update event of your form and each of the controls.

Do some thorough testing with this. There may be some other events you need to fire this sub with.

If you try and it doesn't work, post the code you've got and tell us what is happening and we'll get you the rest of the way there.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
I tried this, I doubt I'm even close.

Code:
Private Sub Form_Current()
If Me![Mydate] = Null Or Me![StartTime] = Null Or Me![EndTime] = Null Then
Me.AllowAdditions = False
Else
Me.AllowAdditions = True
End If
End Sub

Could you get me on the right path,Please????????
 
Jailer,

It all looks good to me. What's actually happening?

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Thank You. I've got it working now. I really appreciate your time.[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top