ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Morning,
I have a worksheet database of which if i double click a customers name in column A a userform opens & all his data "of which is the same as worksheet" is shown.
This works fin BUT TextBoxes 2-7 are empty ?
The worksheet row is A-W
Do you see an error as to why this is happening.
Thanks
This is the double click code.
This is the Database Load Data code
I have a worksheet database of which if i double click a customers name in column A a userform opens & all his data "of which is the same as worksheet" is shown.
This works fin BUT TextBoxes 2-7 are empty ?
The worksheet row is A-W
Do you see an error as to why this is happening.
Thanks
This is the double click code.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Range("A6", Cells(Rows.Count, "A").End(xlUp)), Target) Is Nothing Then Exit Sub
Cancel = True
Database.LoadData Me, Target.Row
End Sub
This is the Database Load Data code
Code:
Sub LoadData(ByVal ws As Worksheet, ByVal rw As Long)
Set m_ws = ws
m_rw = rw
Me.txtCustomer.Value = m_ws.Range("A" & m_rw).Value
Me.txtRegistrationNumber.Value = m_ws.Range("B" & m_rw).Value
Me.txtBlankUsed.Value = m_ws.Range("C" & m_rw).Value
Me.txtVehicle.Value = m_ws.Range("D" & m_rw).Value
Me.txtButtons.Value = m_ws.Range("E" & m_rw).Value
Me.txtKeySupplied.Value = m_ws.Range("F" & m_rw).Value
Me.txtTransponderChip.Value = m_ws.Range("G" & m_rw).Value
Me.txtJobAction.Value = m_ws.Range("H" & m_rw).Value
Me.txtProgrammerCloner.Value = m_ws.Range("I" & m_rw).Value
Me.txtKeyCode.Value = m_ws.Range("J" & m_rw).Value
Me.txtBiting.Value = m_ws.Range("K" & m_rw).Value
Me.txtChassisNumber.Value = m_ws.Range("L" & m_rw).Value
Me.txtVehicleYear.Value = m_ws.Range("N" & m_rw).Value
Me.txtPaid.Value = m_ws.Range("O" & m_rw).Value
Me.txtInvoiceNumber.Value = m_ws.Range("P" & m_rw).Value
Me.TextBox1.Value = m_ws.Range("Q" & m_rw).Value
Me.TextBox2.Value = m_ws.Range("R" & m_rw).Value
Me.TextBox3.Value = m_ws.Range("S" & m_rw).Value
Me.TextBox4.Value = m_ws.Range("T" & m_rw).Value
Me.TextBox5.Value = m_ws.Range("U" & m_rw).Value
Me.TextBox6.Value = m_ws.Range("V" & m_rw).Value
Me.TextBox7.Value = m_ws.Range("W" & m_rw).Value
Me.ComboBoxCustomersNames.Value = m_ws.Range("A" & m_rw).Value
With Me.txtCustomer
.SetFocus
.SelStart = 0
.SelLength = Len(.Value)
End With
Me.Show
End Sub