I'm really desperate.
Each time i enter a form, it saves a record automatically, wich is fine if it's a new record (Button "New Budget").
But for an existing record (for View/Edit Budget by BID), it´s a problema, because it´s saves the record you're editing plus another record (the one it saves entering the form).
I use a filter (Click event + Form Load):
Expand|Select|Wrap|Line Numbers
- Private Sub btn3_Click()
- If IsNull(txtClientName) Then
- MsgBox ("Please select a client")
- Else
- DoCmd.Close acForm, "Menu Budgets"
- DoCmd.OpenForm "O_2 - Avaliação Clínica Inicial" ', acNormal, , , , , Me.BID
- DoCmd.ApplyFilter "SELECT [O_2-AvaliaçãoClínicaInicial].* FROM [O_2-AvaliaçãoClínicaInicial] WHERE BID = TempVars!TempBID"
- End If
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Load()
- DoCmd.Maximize
- txtBID.Value = TempVars!TempBID
- txtClientName.Value = TempVars!TempClientName
- Me.Form.Filter = "BID=" & Me.txtBID
- Me.Form.FilterOn = True
- End Sub
Thanks in advance...