Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parametized Query

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
I have this parametized query:
Code:
PARAMETERS paramSling Short, paramLand Short, paramTSN IEEEDouble paramCraftID Text ( 7 );
INSERT INTO tblLogs ( Sling, Land, ENG_TSN, CraftID )
VALUES ([paramSling], [paramLand], [paramTSN], [paramCraftID]);
and I'm using this code to fill in the parameters:
Code:
With CurrentDb.QueryDefs("qryResetMaint")        
        If Me.chbxEngTSN Then
            .Parameters("paramTSN").Value = Me.txtEngTSN.Value - Me.txtCurEngTSNTot.Value
        Else
            .Parameters("paramTSN").Value = 0
        End If
        If Me.chbxLand Then
            .Parameters("paramLand").Value = Me.txtLand.Value - Me.txtCurLandTot.Value
        Else
            .Parameters("paramLand").Value = 0
        End If        
        If Me.chbxSling Then
            .Parameters("paramSling").Value = Me.txtSling.Value - Me.txtCurSlingTot.Value
        Else
            .Parameters("paramSling").Value = 0
        End If        
        .Parameters("paramCraftID").Value = Me.OpenArgs
        .Execute
      End With
I'm getting 'Too few parameters expected'. Isn't the code above the proper way of filling in the parameter values? Any help on this would be appreciated.

Thanks,
Rewdee
 
It this a typo?
Code:
PARAMETERS paramSling Short, paramLand Short, paramTSN [red]IEEEDouble[/red] paramCraftID Text ( 7 );

Seems like it should be:
Code:
PARAMETERS paramSling Short, paramLand Short, paramTSN Double, paramCraftID Text ( 7 );

VBSlammer
redinvader3walking.gif

[sleeping]Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top