continuous form issues

Hecronis

Registered User.
Local time
Today, 06:18
Joined
Apr 26, 2016
Messages
60
I have two issues I'm running into tonight. Using a continuous form I've created a basic roll call where I am able to enter the date of a class and track how many classes each client attended using an append query. The clients ID #'s are being pulled from their info on one table (where most of their info is stored) and copying it over to the class table. I would like to have the button that saves the record also clear the form so I can track the other days with out having to go through and clear out each text box manually. The only stuff like that that I have been able to find is changing data entry on the form properties to YES. However the other thing I'm having a hard time with is I also need a look up feature so I can edit the attendance for previous dates in that same form. I've tried something similar before and quickly learned that I wasn't able to recall records if a form is data entry enabled. I know these two things has to be simple but I'm just not getting this.

I forgot that there are some NULL values that would effect the search. I have around 80 clients at any time but not all of them do classes on the same day. The will only make a record if there is a value placed in the attendance box not if it is blank. So there may be only be 60 out of 80 people attending classes. If I do a search I need to be able to pull up all 80 records for that day.
 
Last edited:
Since Access automatically saves a Record, when moving to another Record, on a Bound Form, all you really need for your button to do would be to move to a New Record; doing so will move to a New, blank Record:

DoCmd.GoToRecord , , acNewRec

Linq ;0)>
 
I've tried that but it creates a new record at the bottom of the page like I'm adding a client. I'm usually entering several days worth of class records in at a time, I'll put in the attendance for one date and submit it and it get's recorded on the correct table, however the values in the text fields wont reset back to blank. So when I go to put in the next days attendance I have to go through and clear out all of the numbers from the previous set I just recorded. I have this code under my submit button and it will clear the fields like I want, but only for the first record.

Private Sub Command82_Click()
On Error GoTo Command82_Click_Err

DoCmd.RefreshRecord
DoCmd.OpenQuery "Meeting Attendence", acViewNormal, acEdit
Beep
MsgBox "This date has been added.", vbOKOnly, "Heck Yeah!!!"

Me.In_House.Value = ""
Me.Outside.Value = ""

Command82_Click_Exit:
Exit Sub

Command82_Click_Err:
MsgBox "It didn't take. Sorry.", vbOKOnly, "Tech support will look at it later"
Resume Command82_Click_Exit

End Sub

I think to go this route I would need to do a loop? I tried to figure out how to have it automatically loop through all of the records on the form changing the values back, return to the top record, and stop but I don't know enough about this kind of stuff to get it to work.
 
you need to change your recordsource.
first time the form opens you need an empty recordsource.

private sub form_open(cancel as integer)
me.recordsource = "select field1, field2, field3 from table where (1=0);"
end sub

on the event/code where you insert record to class record, add another code to change the form's recordsource again:

me.recordsource = "select field1, field2, field3 from table where [datefield] =#" & format(me.datecontrol, "mm/dd/yyyy") & "# ;"


on the button that clears the form's textboxes, just set to null recordsource:

me.recordsource = "select field1, field2, field3 from table where (1=0);"
 
Here is how I have it set up. I followed an online tutorial to make it.
 

Attachments

Users who are viewing this thread

Back
Top Bottom