No next record visibility on continuous form until all fields completed

brucemc777

Member
Local time
Today, 15:46
Joined
Nov 1, 2012
Messages
65
Thanks for considering my nightmare-

I am using a continuous form for data entry where each record has only two user entry fields and a row of two fields constitutes a record.

It is generally probable that when the user is inputting there would be five to ten records at a time to input.

I do not want the next record entry line to show up until both of the prior record fields are populated, even if this means turning off a setting in the process and the user having to click a button to add another entry (which, frankly, is preferable), so no item is missed.

I will likely be conditionally color coding each row as an additional notice to them (her...). (No, that is not an insult to the person in question who will be doing the inputting, only my fear of mistakes that could be complicated by the next record opening for input prior to the present being completed - i don't want any congestion nor distraction until each record is completed.)

Though i am getting better at this (Access and VBA), i still am doing a lot of trial and a lot more errors which gets frustrating, but i hope it is the best way for me to learn as i do-

Thank you for your thoughts!

-Bruce
 
I do not want the next record entry line to show up until both of the prior record fields are populated, even if this means turning off a setting in the process and the user having to click a button to add another entry (which, frankly, is preferable), so no item is missed.
There is nothing wrong with the new, empty row showing up immediately. Only ONE record can ever have the focus at one time. What you need to do is to learn how to use the form's BeforeUpdate event so you can ensure that each input record is complete before you allow the user to save the current record and move on to a new one.

Here are a couple of videos that show how form events work. There is also a database that you can use to help yourself learn about events. View at least one of the videos first so you will understand how the sample database works.

 
add code to the Form's BeforeUpdate event:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Cancel = IsNull(Me.yourTextbox1)
If Cancel Then
    Msgbox "You need to fill up yourTextbox1 before you can save this record."
    Me.yourTextbox1.Setfocus
    Exit Sub
End If
' check the other textnbox
Cancel = IsNull(Me.yourTextbox2)
If Cancel Then
    Msgbox "You need to fill up yourTextbox2 before you can save this record."
    Me.yourTextbox2.Setfocus
End If
End Sub
 
Wow. Y'all are great! I am hoping to watch Pat's video and view some of the examples today (this is not my means of income, and it seems bills still need to be paid), but for a short bit i was figuring out how using the before update event would be effectively implemented in the record's fields controls!- That gives you an idea how much this is not yet a native environment for me... The Form's event... Of course!

And Access would have been a much better choice for my old Excel project that i started back in 2015/2016 and still tweak to this day, some 50,000+ lines of code later, but my other two colleagues that are in the same line of business wanted Excel due to their complete lack of understanding of Access (they had no clue as to what VBA is, so why would it matter?). I have the idea in the back of my head to start converting that project after i provide my friend with this one, but that kind of scares me - it would be so much better and efficient, but it would be a black hole as far as time is concerned (and my wife of something like 28 years (i really need to look that up as the anniversary is coming up in a couple of months) might divorce me if i dig into yet another project)...

Anyways, thank you very much, both Pat and arnelgp, i really do appreciate you folks coming to my aid.

Best Regards,
Bruce

P.S. My picture of the rattlesnake is a reminder to me that God does lend a hand to the stupid. Some 17 years ago i chaperoned an overnite field trip for one of my 4 daughters to "Painted Rock" in TX. When i got up we were climbing the rock (more like a moon that hit the Earth) and someone said "A snake just went under that ledge!", so i, being fascinated with all things, took my little digital camera in hand, stuck my arm under the ledge snapped a picture, pulled my arm out and then looked at it. Did you ever have that "What the heck did i just do?" feeling?
 

Users who are viewing this thread

Back
Top Bottom