S
sebastico
Dear all
I have the Table SigNum with the fields:
CodSig (PK) (string)
Prov (string)
Cant (string)
Dist (string)
Bloq (string)
Sec (string)
NumPar (string)
The PK must be the combination of fields Prov, Cant, Dist, Bloq, Sec NumPar
I have the code:
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "FirstField = " & Me.TextBox1 & " " & _
"AND SecondField = " & Me.TextBox2 & " " & _
"AND ThirdField = " & Me.TextBox3 & " " & _
"AND FourthField = " & Me.TextBox4 & " " & _
"AND FifthField = " & Me.TextBox5 & " " & _
"AND SixthField = " & Me.TextBox6 & " " & _
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
However, in the form (based on the Table SigNum) when I type a value in the
fields the PK field does not display it. I need that when I type a value in a
field, the PK field automatically display it. How do I do this?
Help please
Many thanks in advance.
I have the Table SigNum with the fields:
CodSig (PK) (string)
Prov (string)
Cant (string)
Dist (string)
Bloq (string)
Sec (string)
NumPar (string)
The PK must be the combination of fields Prov, Cant, Dist, Bloq, Sec NumPar
I have the code:
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "FirstField = " & Me.TextBox1 & " " & _
"AND SecondField = " & Me.TextBox2 & " " & _
"AND ThirdField = " & Me.TextBox3 & " " & _
"AND FourthField = " & Me.TextBox4 & " " & _
"AND FifthField = " & Me.TextBox5 & " " & _
"AND SixthField = " & Me.TextBox6 & " " & _
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
However, in the form (based on the Table SigNum) when I type a value in the
fields the PK field does not display it. I need that when I type a value in a
field, the PK field automatically display it. How do I do this?
Help please
Many thanks in advance.