Getting data into a cell

Closed
Kent - Apr 22, 2010 at 03:42 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Apr 22, 2010 at 05:04 AM
I have a VBA Form which gets data from a row on the selection of a name in a dropdown (name is from dynamic range). I would then like the data on clicking 'OK' to be updated for that row but I can't seem to get the information from the controls to update their respective cells!
The code:
'-------------------------------------------------------------------------
'UPDATE CLIENT DETAILS
'-------------------------------------------------------------------------
Private Sub CommandOK1_Click()
ActiveWorkbook.Sheets("CLIENT_SHEET").Activate
'-------------------------------------------------------------------------
'Client Details Update
'-------------------------------------------------------------------------
Cells(SelLine, 2).Select
ActiveCell.Value = CmbCLIENTNAME.Value
ActiveCell.Offset(0, 1) = TxtADRESS.Value
ActiveCell.Offset(0, 2) = TxtPOSTCODE.Value
ActiveCell.Offset(0, 3) = CmbGENDER.Value
ActiveCell.Offset(0, 4) = CmbSEX.Value
ActiveCell.Offset(0, 5) = TxtDOB.Value
ActiveCell.Offset(0, 6) = CmbETHNIC.Value
If OptBPREGNO = True Then
ActiveCell.Offset(0, 7).Value = "0"
ElseIf OptBPREGYES = True Then
ActiveCell.Offset(0, 7).Value = "1"
Else
ActiveCell.Offset(0, 7).Value = ""
End If

what appears is the data that was already there, not the updated values from the form - the Option buttons do seem to work ok??

Help would be appreciated.



1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Apr 22, 2010 at 05:04 AM
Could you please upload a sample file on some shared site like https://authentification.site and post back here the link to allow better understanding of how it is now and how you foresee.
0