Form Views

shelds

New member
Local time
Today, 11:51
Joined
Mar 6, 2007
Messages
9
I have a form where after you select an option from a combo box, it will show a new record ready for data entry, however it is a continuous form and so you can view the previous records on the same form which is really handy.

However, I've recently copied this database, renamed it and for some reason the form no longer shows a new record it just shows all previously entered records and will not only show a new record. If you changed the view to single forms it is okay, but I want it so when you goto the previous record it shows these on the form also (i.e more than one record at time).

I've checked the vb code on the after update function on my combo box and it shows the same code as on the database that works, is there another option that I need to set?
 
I already have both scroll bars enabled. It appears as if its a bit of code thats not executing (but I don't understand why because I've made a replica of the database).

This is the code after update:

Code:
Private Sub cboanalyst_AfterUpdate()
Call SetupForm
DoCmd.GoToRecord , , acNewRec - I thought this part should go to new record but don't think it is.

End Sub



Private Sub SetupForm()


Dim strSQL As String
Dim strCat As String

'gives radio button options a value

Select Case Me.froptions.Value
    Case Is = 1
        strCat = "Daily"
    Case Is = 2
        strCat = "Weekly"
    Case Is = 3
        strCat = "Monthly"
    Case Is = 4
        strCat = "Bi-Annual"
    Case Else
        strCat = "Annual"
End Select

'Selects checks that are assigned to an analyst

strSQL = "SELECT tbl_checkinstance.CheckType_id, tbl_checkinstance.Analyst_id, tbl_checkinstance.Check_date, tbl_checkinstance.date_added, " & _
         " tbl_checkinstance.Completed, tbl_checkinstance.Comments, tbl_checkinstance.Call_Ref, " & _
         " tbl_checkinstance.Backup_time, tbl_checkinstance.Backup_size, tbl_checkinstance.Backup_Status, tbl_checktype.Category " & _
         " FROM tbl_checktype INNER JOIN tbl_checkinstance ON tbl_checktype.CheckType_id = tbl_checkinstance.CheckType_id " & _
         " WHERE (((tbl_checkinstance.Analyst_id)=" & Nz(Me.cboanalyst.Value, 0) & ") AND ((tbl_checktype.Category)='" & strCat & "')AND tbl_checktype.active = true)" & _
         " ORDER BY tbl_checkinstance.Check_date"
Me.RecordSource = strSQL

'Selects checks that match the category selected in the form, and orders by assigned checks, then all remaining checks below

strSQL = "SELECT DISTINCTROW tbl_checktype.CheckType_id, tbl_checktype.CheckName " & _
         " FROM tbl_checktype LEFT JOIN tbl_analystcheck ON tbl_checktype.CheckType_id = tbl_analystcheck.Checktype_id " & _
         " GROUP BY tbl_checktype.CheckType_id, tbl_checktype.CheckName, IIf([tbl_analystcheck]![Analyst_id]=" & Nz(Me.cboanalyst.Value, 0) & _
         ",0,1), tbl_checktype.CheckName, tbl_checktype.Category, tbl_checktype.Active " & _
         "HAVING (((tbl_checktype.Category)='" & strCat & "') AND ((tbl_checktype.Active)=True)) " & _
         " ORDER BY IIf([tbl_analystcheck]![Analyst_id]=" & Nz(Me.cboanalyst.Value, 0) & ",0,1), tbl_checktype.CheckName;"

Me.CboCheckName.RowSource = strSQL
Me.Requery
Me.CboCheckName.Requery



End Sub
 
In the properties of the continuous forms, is it set for "Allow Additions"?
 
Yes Allow Additions is set to yes. Data entry is set to no so we can still have visibility of the other records. We want a data entry type view to start with so you can see only the new record your about to enter, but after you've entered that record, you can still see after you've other records until you exit the form.

Please see attached jpg withing zip file for how after update of the combo box it currently appears. In the copy of the database before it used to flash quickly so you could see the records for a split second then just show a empty record. After entering the first new record you can continue to see other records you've entered in your current session until closing the form similar to how it looks in the jpg
 

Attachments

I've just done some testing on the database where this worked. I have found that where there are over 100+ records that have been entered previously it will automatically go to a new record and only show that row in the subform. Is there a property somewhere either in the subform or in Access where you reduce or see the max amount of records that continuous forms can display?
 
Resolved the problem it appears that the max records that a continous form can display is 10. After the tenth record it automatically opens on a new record.
 

Users who are viewing this thread

Back
Top Bottom