Button Control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tmdrake
    New Member
    • Mar 2013
    • 43

    Button Control

    The form I'm creating will allow the user to registar welds based on a numerbic intervale (ex. 1 of 3). Now if the user is only making 1 weld register and click one of the buttons, it saves to the table fine. However if the user is trying to registar more than 1 registar weld (ex: 2 of 3) and clicks a different button on the second of third weld, then the SN for the second and third welds are not saving in the table on a different line.

    Example: 1 of 3
    sn = xxxxxxxxx = "Good"
    sn = ccccccccc = "POP"
    sn = bbbbbbbbb = "Other"

    Recorded on the table would read:
    sn = xxxxxxxxx = "Good" (WeldResults); "POP"(WeldResul ts1); "Other" (Weldresults2)

    All of this would be on one line in the table instead of 3 different lines in the table.

    How do I fix this? Here is the code for the textboxes:
    "Good" textbox
    Code:
    Private Sub Text55_Click()
    DoCmd.RunCommand acCmdSaveRecord
    If Not IsNull(Me.SN.Value) Then
        LastPosSN = Me.SN.Value
    End If
    If PosPullTestCount = Me.PullTestNum.Value Then
        MsgBox "Time to perform a pull-test on a scrap cell!"
        PosPullTestCount = 1
        Me.Text30.Value = Me.PullTestNum.Value
        DoCmd.OpenForm "GeneralTabPullTest"
        DoCmd.GoToRecord , , acNewRec
        Forms!GeneralTabPullTest!LotNumber = Me.LotNumber
        Forms!GeneralTabPullTest!CreationDate = Now()
    Else
        PosPullTestCount = PosPullTestCount + 1
        Me.Text30.Value = Me.PullTestNum.Value
    End If
    
    End Sub
    "POP" Textbox:
    Code:
    Private Sub Text52_Click()
    DoCmd.RunCommand acCmdSaveRecord
    MsgBox "CLEAN ELECTRODES NOW"
    If Not IsNull(Me.SN.Value) Then
        LastPosSN = Me.SN.Value
    End If
    If PosPullTestCount = Me.PullTestNum.Value Then
        MsgBox "Time to perform a pull-test on a scrap cell!"
        PosPullTestCount = 1
        Me.Text30.Value = Me.PullTestNum.Value
        DoCmd.OpenForm "GeneralTabPullTest"
        DoCmd.GoToRecord , , acNewRec
        Forms!GeneralTabPullTest!LotNumber = Me.LotNumber
        Forms!GeneralTabPullTest!CreationDate = Now()
    Else
        PosPullTestCount = PosPullTestCount + 1
        Me.Text30.Value = Me.PullTestNum.Value
    End If
    End Sub
    Hope this makes sense, any help would be appreciated. I not sure why it's not recording the choices independently.

    Thanks
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Unfortunately, this doesn't make much sense. Originally, it seems like there is are three separate fields for the welds, and then it seems like there is only one field that you want to populate with the type of weld. In you example 1 of 3, what is the XXXXXXX and CCCCCCCC and BBBBBBBBB? Perhaps showing the table structure would be helpful.

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      It really sounds like you need to read thru: > Database Normalization and Table Structures.

      There should be a series of tables... say one for your project, one that relates welds to the project, etc...

      Comment

      Working...