edgarchado
Technical User
Hi,
I Have the following code. Tha idea is that if tblPedido.Anulado is equal to False (Anulado is has a Yes/no type) when I double click a line in a listbox it will open a form. This listbox is populated by a search function. I need to open two different forms depending on the information stored in the anulado field (True or false).
The Docmd Event works when there is no If statement. What should I do so it works with the if?
Thanks in advance.
Private Sub lstPedido_DblClick(Cancel As Integer)
If tblPedido.Anulado = False Then
DoCmd.OpenForm "frmVisualizarPedido", , , "[N°_de_Pedido] = " & Me.lstPedido, acFormReadOnly, acDialog
Else
DoCmd.OpenForm "frmVisualizar_Pedido_Anulado", , , "[N°_de_Pedido] = " & Me.lstPedido, acFormReadOnly, acDialog
End If
End Sub
I Have the following code. Tha idea is that if tblPedido.Anulado is equal to False (Anulado is has a Yes/no type) when I double click a line in a listbox it will open a form. This listbox is populated by a search function. I need to open two different forms depending on the information stored in the anulado field (True or false).
The Docmd Event works when there is no If statement. What should I do so it works with the if?
Thanks in advance.
Private Sub lstPedido_DblClick(Cancel As Integer)
If tblPedido.Anulado = False Then
DoCmd.OpenForm "frmVisualizarPedido", , , "[N°_de_Pedido] = " & Me.lstPedido, acFormReadOnly, acDialog
Else
DoCmd.OpenForm "frmVisualizar_Pedido_Anulado", , , "[N°_de_Pedido] = " & Me.lstPedido, acFormReadOnly, acDialog
End If
End Sub