User Form - Save Changes

LONeill13

Board Regular
Joined
Feb 12, 2013
Messages
135
Hello Again:

I am almost done with my user form. The last piece I'm struggling with is the Save Changes code. I am able to find/search for a record and I want the user to be able to update the record and save the changes (on the line the record is found, not add a new record). However, when I tried to modify a record and "Save" the changes, nothing happens.


Here is the code I'm using:
Code:
Private Sub cmdSave_Click()    Application.ScreenUpdating = False
    If r <= 0 Then Exit Sub


    Set c = Ws.Cells(r, 1)
    c.Value = Me.tbMemNum.Value          ' write amendments to database
c.Offset(0, 1).Value = Me.tbDate1.Value
c.Offset(0, 2).Value = Me.cboIssueType.Value
c.Offset(0, 3).Value = Me.cboIssueReportedBy.Value
c.Offset(0, 4).Value = Me.tbDateIssue.Value
c.Offset(0, 5).Value = Me.cboIssueStatus.Value
c.Offset(0, 6).Value = Me.tbSource.Value
c.Offset(0, 7).Value = Me.tbOpenDate.Value
c.Offset(0, 8).Value = Me.tbEnrollMeth.Value
c.Offset(0, 9).Value = Me.cboUI.Value
c.Offset(0, 10).Value = Me.tbFName.Value
c.Offset(0, 11).Value = Me.tbLName.Value
c.Offset(0, 12).Value = Me.tbAddress.Value
c.Offset(0, 13).Value = Me.tbCity.Value
c.Offset(0, 14).Value = Me.tbState.Value
c.Offset(0, 15).Value = Me.tbZip.Value
c.Offset(0, 16).Value = Me.tbFraud.Value
c.Offset(0, 17).Value = Me.tbBonusPt.Value
c.Offset(0, 18).Value = Me.tbGoldPt.Value
c.Offset(0, 19).Value = Me.tbOtherPt.Value
c.Offset(0, 20).Value = Me.tbPtsRedeemed.Value
c.Offset(0, 21).Value = Me.tbPoint.Value
c.Offset(0, 22).Value = Me.tbDollar.Value
c.Offset(0, 23).Value = Me.cboSiteID.Value
c.Offset(0, 24).Value = Me.Brand.Caption
c.Offset(0, 25).Value = Me.SiteAdd.Caption
c.Offset(0, 26).Value = Me.GM.Caption
c.Offset(0, 27).Value = Me.Owner.Caption
c.Offset(0, 28).Value = Me.tbSummary.Value
c.Offset(0, 29).Value = Me.cboCredit.Value
c.Offset(0, 30).Value = Me.tbCrAmt.Value
c.Offset(0, 31).Value = Me.tbCrDate.Value
    'restore Form
    With Me
        .cmdSave.Enabled = True
        .cmdAdd.Enabled = False
        .Height = frmHt
    End With
    If Sheet1.AutoFilterMode Then Sheet1.Range("A1").AutoFilter
    Application.ScreenUpdating = True
    On Error GoTo 0
End Sub

I have cross posted this here: http://www.excelforum.com/excel-pro...rds-listbox-populating-issue.html#post4119342
 
Last edited:

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Watch MrExcel Video

Forum statistics

Threads
1,123,531
Messages
5,602,209
Members
414,513
Latest member
junbuggle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top