locked
MS Access Insert RRS feed

  • Question

  • User547096447 posted

    Hi,

     I'm trying to use FormView with an Access Data Source to create a new record in my DB.  However, when I try to run it, I get the following error: 

    You tried to assign the Null value to a variable that is not a Variant data type.

     I'm assuming this is because of the AutoID Field, which I cannot specify in the FormView.  Is there a specific way to do this?

     Thanks.

    Monday, May 12, 2008 4:37 PM

Answers

  • User-821857111 posted

    Try removing the Autonumber field from the InsertCommand, and make sure it isn't listed in the InsertParameters collection.  If that doesn't help, show your code.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 12, 2008 5:38 PM
  • User-821857111 posted

     

    I haven't customized anything yet, so there is no code

    Errmmm.... the stuff in the aspx file is code. Well, declarative mark-up, but that's what I meant.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 13, 2008 2:21 AM

All replies

  • User-821857111 posted

    Try removing the Autonumber field from the InsertCommand, and make sure it isn't listed in the InsertParameters collection.  If that doesn't help, show your code.

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 12, 2008 5:38 PM
  • User547096447 posted

    I haven't customized anything yet, so there is no code...I'm first just trying to get the FormView InsertItem template to add a record...

    Tuesday, May 13, 2008 1:39 AM
  • User-821857111 posted

     

    I haven't customized anything yet, so there is no code

    Errmmm.... the stuff in the aspx file is code. Well, declarative mark-up, but that's what I meant.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 13, 2008 2:21 AM