Data Form Wizard not Working

data form wizard not working?

Page 1 of 1

7 Replies - 1648 Views - Last Post: 25 September 2009 - 02:47 AM Rate Topic: -----

#1 ravmonster  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 162
  • Joined: 20-July 09

Data Form Wizard not Working

Posted 20 September 2009 - 09:07 AM

Private Sub Form_Load()
  Set grdDataGrid.DataSource = datPrimaryRS.Recordset("ChildCMD").UnderlyingValue
End Sub

Private Sub Form_Resize()
  On Error Resume Next
  'This will resize the grid when the form is resized
  grdDataGrid.Width = Me.ScaleWidth
  grdDataGrid.Height = Me.ScaleHeight - grdDataGrid.Top - datPrimaryRS.Height - 30 - picButtons.Height
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Screen.MousePointer = vbDefault
End Sub

Private Sub datPrimaryRS_Error(ByVal ErrorNumber As Long, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, fCancelDisplay As Boolean)
  'This is where you would put error handling code
  'If you want to ignore errors, comment out the next line
  'If you want to trap them, add code here to handle them
  MsgBox "Data error event hit err:" & Description
End Sub

Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
  'This will display the current record position for this recordset
  datPrimaryRS.Caption = "Record: " & CStr(datPrimaryRS.Recordset.AbsolutePosition)
End Sub

Private Sub datPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
  'This is where you put validation code
  'This event gets called when the following actions occur
  Dim bCancel As Boolean

  Select Case adReason
  Case adRsnAddNew
  Case adRsnClose
  Case adRsnDelete
  Case adRsnFirstChange
  Case adRsnMove
  Case adRsnRequery
  Case adRsnResynch
  Case adRsnUndoAddNew
  Case adRsnUndoDelete
  Case adRsnUndoUpdate
  Case adRsnUpdate
  End Select

  If bCancel Then adStatus = adStatusCancel
End Sub

Private Sub cmdAdd_Click()
  On Error GoTo AddErr
  datPrimaryRS.Recordset.AddNew

  Exit Sub
AddErr:
  MsgBox Err.Description
End Sub

Private Sub cmdDelete_Click()
  On Error GoTo DeleteErr
  With datPrimaryRS.Recordset
	.Delete
	.MoveNext
	If .EOF Then .MoveLast
  End With
  Exit Sub
DeleteErr:
  MsgBox Err.Description
End Sub

Private Sub cmdRefresh_Click()
  'This is only needed for multi user apps
  On Error GoTo RefreshErr
  datPrimaryRS.Refresh
  Set grdDataGrid.DataSource = datPrimaryRS.Recordset("ChildCMD").UnderlyingValue
  Exit Sub
RefreshErr:
  MsgBox Err.Description
End Sub

Private Sub cmdUpdate_Click()
  On Error GoTo UpdateErr

  datPrimaryRS.Recordset.UpdateBatch adAffectAll
  Exit Sub
UpdateErr:
  MsgBox Err.Description
End Sub

Private Sub cmdClose_Click()
  Unload Me
End Sub




this codes are generated using DATA FORM WIZARD..
but i can not run it...i want to add this form on the project i have created
but it won't run....it shows a "Compliler Error... procedure declaration does not match description..."
WHY? pls help... :) :) :)

Is This A Good Question/Topic? 0
  • +

Replies To: Data Form Wizard not Working

#2 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Data Form Wizard not Working

Posted 20 September 2009 - 05:09 PM

this is becuase you did not use some controls that you mention here
Was This Post Helpful? 0
  • +
  • -

#3 ravmonster  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 162
  • Joined: 20-July 09

Re: Data Form Wizard not Working

Posted 21 September 2009 - 06:52 AM

View Postthava, on 20 Sep, 2009 - 04:09 PM, said:

this is because you did not use some controls that you mention here

what do you mean by the controls??

isn't it that controls are automatically generated by the Wiszard??

i have tried using another binding type which is "Class" on the wizard..
and it works....

what is the diff. on the binding types???
Was This Post Helpful? 0
  • +
  • -

#4 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Data Form Wizard not Working

Posted 21 September 2009 - 06:29 PM

do you know what object is this

datPrimaryRS
Was This Post Helpful? 0
  • +
  • -

#5 ravmonster  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 162
  • Joined: 20-July 09

Re: Data Form Wizard not Working

Posted 22 September 2009 - 06:04 PM

View Postthava, on 21 Sep, 2009 - 05:29 PM, said:

do you know what object is this

datPrimaryRS



NO...
do you?

:) :) :) :)
Was This Post Helpful? 0
  • +
  • -

#6 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Data Form Wizard not Working

Posted 22 September 2009 - 06:11 PM

yeah this is a recordset with events or a adodb control did you have it
did you declare that
Was This Post Helpful? 0
  • +
  • -

#7 ravmonster  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 162
  • Joined: 20-July 09

Re: Data Form Wizard not Working

Posted 25 September 2009 - 01:21 AM

i have another question

HOW can i make my connection to access dynamic

meaning if i will transfer the program I created and the database to a different
directory (ex. c:\ to descktop) i can still access the database....

what should i change in the connection string..? if it's in the conn. string... :D :D
Was This Post Helpful? 0
  • +
  • -

#8 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Data Form Wizard not Working

Posted 25 September 2009 - 02:47 AM

use the path where ever the database is otherwise there is no possibility
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1