I have a continuous form with a select query as the record source.
The first three controls on the form are bound to the query.
If I bind the last two controls I can't write to them. If I leave them unbound then a change in any of the unbound controls affects the entire column.
Is there a simple way around this or do I resort to a single form and bind that to the table rather than a query?
The SQL for the query follows
The first three controls on the form are bound to the query.
If I bind the last two controls I can't write to them. If I leave them unbound then a change in any of the unbound controls affects the entire column.
Is there a simple way around this or do I resort to a single form and bind that to the table rather than a query?
Code:
Option Compare Database
Option Explicit
Private Sub btnClose_Click()
DoCmd.Close acForm, Me.Name
' DoCmd.OpenForm "Choices"
End Sub
Private Sub Form_Current()
Dim bCount As Integer
bCount = DCount("*", "Main", "isnull([BayNo])")
If bCount = 0 Then
Call btnClose_Click
End If
Me.txtBay.SetFocus
End Sub
Private Sub txtShelf_AfterUpdate()
' DoCmd.OpenQuery shelfQ
' DoCmd.openqueryNewShelfQ
Me.txtBay = ""
Me.txtShelf = ""
End Sub
Private Sub txtShelf_GotFocus()
Me.txtShelf.BackColor = RGB(218, 255, 94)
End Sub
Private Sub txtbay_GotFocus()
Me.txtBay.BackColor = RGB(218, 255, 94)
End Sub
Private Sub txtBay_LostFocus()
Me.txtBay.BackColor = RGB(240, 240, 240)
End Sub
Private Sub txtShelf_LostFocus()
Me.txtShelf.BackColor = RGB(240, 240, 240)
End Sub
The SQL for the query follows
Code:
SELECT Main.Family, Main.Infrafamily, Main.BoxNo, Main.BayNo, Main.ShelfNo
FROM Main
GROUP BY Main.Family, Main.Infrafamily, Main.BoxNo, Main.BayNo, Main.ShelfNo
HAVING (((Main.BoxNo) Is Not Null))
ORDER BY Main.Family, Main.Infrafamily, Main.BoxNo;