Re: Concatenate field as PK

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Dear Steve
Many thanks for your kindness. However, my CodSig must be the concatenation
of fields: Prov, Cant, Dist, Bloq, Sect and NumParc.
Have you got another sugg.

"Steve" wrote:

You can make it easy on yourself by adding a field named SigNumID to your
table and making it autonumber. It will self-populate when you add the field
and will self-populate when you add new records.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@xxxxxxxxxxxxxxx



"sebastico" <sebastico@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:18E17DD3-8B06-45DA-B65B-72F7899C0E30@xxxxxxxxxxxxxxxx
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.




.



Relevant Pages

  • Re: Concatenate field as PK
    ... CodSig (string) ... The PK must be the combination of fields Prov, Cant, Dist, Bloq, ... Sec NumPar I have the code: ...
    (microsoft.public.access.forms)
  • Re: Concatenate field as PK
    ... Function CodSigCat() As String ... Prov, Cant, Dist, Bloq, Sect and NumParc. ... NumPar (string) ...
    (microsoft.public.access.forms)
  • Re: Concatenate field as PK
    ... Function CodSigCat() As String ... Prov, Cant, Dist, Bloq, Sect and NumParc. ... NumPar (string) ...
    (microsoft.public.access.forms)
  • Re: substring finding problem!
    ... peculiar notion of not using standard string functions. ... char *str, ... I added the one because when both string and sub string are equal length the ... i cant compare remaining_len>= 0 since that'll always be true for unsigned. ...
    (comp.lang.c)
  • Re: Lots of help needed urgently
    ... will reveal the passwords that are usually displayed on-screen as a string ... of asterisks. ... > him for help `cos I cant send him an email. ... > COME ON Guys `n Gals help an old dumbass out of this ...
    (microsoft.public.security)