Test Parameter Values for ADODB Connection

If you’re running ADODB to run a stored procedure on say SQL Server.  It’s helpful to know if the parameters you’re expecting to be passed actually are.  Add the For Each code block below just prior to the .Execute and you’ll see the param values in the immediate window

 Set cmd = New ADODB.Command
 With cmd
 .ActiveConnection = CurrentProject.Connection
 .CommandText = "spInsertOrUpdate_OPTJurisCode"
 .Parameters.Append .CreateParameter("RETURN_VALUE", adDouble, adParamReturnValue)
 .Parameters.Append .CreateParameter("@ID", adInteger, adParamInput, lngID)
 .Parameters.Append .CreateParameter("@SourceID", adInteger, adParamInput, CInt(gblSource))
 .Parameters.Append .CreateParameter("@ActionType", adVarChar, adParamInput, 4, gblactionType)
 .Parameters.Append .CreateParameter("@StateID", adInteger, adParamInput, , Me.cmbState)
 .Parameters.Append .CreateParameter("@City", adVarChar, adParamInput, 75, Me.txtCity)
 .Parameters.Append .CreateParameter("@Zip", adVarChar, adParamInput, 7, Me.txtZip)
 .Parameters.Append .CreateParameter("@JurisCode", adVarChar, adParamInput, 50, Me.txtJurisCode)
 .CommandType = adCmdStoredProc
 .CommandTimeout = 0
 'Test Param Values
 For Each prm In cmd.Parameters
 Debug.Print prm.Name & " : " & prm.Value
 End With


Refer to a Subform from another form

This took a while to figure out but Art Polk came to the rescue.

I had a popup form that when a button was pressed I needed to update the subform of the form which created the popup I was currently in.  Basically, I used a popup to edit one of the records in a data grid.  My objective was that once the update was processed the grid would refresh displaying the change…



That’s it