Reset Button not working Properly

tmdrake

Registered User.
Local time
Yesterday, 23:07
Joined
Mar 20, 2013
Messages
15
My form has a reset button that clean all fileds expect date field and its suppose to start the interval count @ 1, however it clears the fields but the interval change does not reset. Not sure how to fix this. Help is greatly appreciated.

Here is the code I'm using:
Code:
[COLOR=black][FONT=Times New Roman][SIZE=3][FONT=Times New Roman]Private Sub Command33_Click()
     PosPullTestCount = 1
     Me.PullTestNum = Null
     Me.Text34 = ""
     Me.Text30 = Null
      Me.Combo18 = Null
      Me.SN = Null[/FONT][/SIZE][/FONT][/COLOR]


"PosPullTestCount" is the field that is suppose to reset to 1.

Thanks:confused:
 
1) vbNullString should be used to blank text fields and initialize string variables. Per:

Nuller Null Suggestion
http://www.access-programmers.co.uk/forums/showpost.php?p=1131047&postcount=41

2) Is PosPullTestCount really the name of a field control? You should fully qualify it with Me.

3) Since you are updating the Value of the field controls, you should fully qualify the .Value property when you get/put the control's value.Ex:

Code:
Public Function Populate(ByRef MePointer As Access.Form, ByVal intProjectID As Integer) As Boolean
On Error GoTo Err_Populate

  'Start by clearing the values from this class instance
  Me.Clear

  'Remember the record ID being searched for
  Me.id = intProjectID

  'Tell the Validation Object (Me) to look up the record
  If Not Me.LocateByID() Then
    Populate = False
    GoTo Exit_Populate
  End If

  'Populate the form fields from the attributes
  [B]MePointer.fldtitle.Value[/B] = Me.title
  [B]MePointer.fldbudget.Value[/B] = Me.budget
  [B]MePointer.fldrptactiveflg.Value[/B] = Me.rptactiveflg
  [B]MePointer.child_subform_lastsaved.Form.fldlastsaveusername.Value[/B] = Me.authusername
  [B]MePointer.child_subform_lastsaved.Form.fldlastsavelogtimestamp.Value[/B] = Me.logtimestamp

  'Good return code
  Populate = True

Exit_Populate:
  Exit Function

Err_Populate:
  Call errorhandler_MsgBox("Class: " & TypeName(Me) & ", Function: Populate()")
  Populate = False
  Resume Exit_Populate

End Function
4) Do you have:

Code:
Option Explicit
set in all of your modules? If not, VBA will not pick up on "speling" mistakes. Perhaps you really meant a valid form control, just slightly spelled it incorrectly.
 

Users who are viewing this thread

Back
Top Bottom