By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,081 Members | 545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,081 IT Pros & Developers. It's quick & easy.

Disabling the Save Button

Abhean
P: 32
Working on a record check and all seems to work as I expected until I attempted to disable one of my buttons on the form. Now, none of the pulled information shows on the form as it did prior to the introduction of
Expand|Select|Wrap|Line Numbers
  1. Me.ClientFullSaveBtn.Enabled = False
. Thoughts or suggestions?

Expand|Select|Wrap|Line Numbers
  1. Private Sub CAccountTxt_AfterUpdate()
  2. Dim db      As DAO.Database
  3. Dim rst     As DAO.Recordset
  4. Set db = CurrentDb()
  5. Set rst = db.OpenRecordset("ClientTbl", dbOpenDynaset)
  6.  
  7.     With rst
  8.            If Not (.BOF And .EOF) Then
  9.                Call .MoveFirst
  10.                .FindFirst "CAccount = '" & Me.CAccountTxt & "'"
  11.                If Not .NoMatch Then
  12.                    'Found it Set all the fields!
  13.                    Me.CStartDate = !CStartDate
  14.                    Me.CClientName = !CClientName
  15.                    Me.CAddress1 = !CAddress1
  16.                    Me.CAddress2 = !CAddress2
  17.                    Me.CZip = !CZip
  18.                    Me.CPhone = !CPhone
  19.                    Me.CFax = !CFax
  20.                    Me.CTimeZone = !CTimeZone
  21.                    Me.CEmail = !CEmail
  22.                    Me.CHours = !CHours
  23.                    Me.CSales = !CSales
  24.                    Me.CCollectionFld = !CCollectionFld
  25.                    Me.CShippingFld = !CShippingFld
  26.                    'Close Save record BTN
  27.                    Me.ClientFullSaveBtn.Enabled = False
  28.  
  29.                Else
  30.                     'Didnt Find Record
  31.  
  32.                 End If
  33.            End If
  34.            Call .Close
  35.        End With
  36.  
  37. Call db.Close
  38. Set rst = Nothing
  39. Set db = Nothing
  40. End Sub
3 Weeks Ago #1
Share this Question
Share on Google+
2 Replies

isladogs
Expert
P: 40
First of all, why are you using an unbound form?
Secondly why disable the Save button on an unbound form?

Thirdly, if you must do this, try adding DoEvents just before the line disabling the button
3 Weeks Ago #2

Abhean
P: 32
This was me playing and testing some ideas. Simply wondering why the result was happening the way it was. Thank you for the response.
3 Weeks Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.