DataBase and form problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Totti

    DataBase and form problem

    Hi everybody,
    VB.6 - I am working on a project that is actually a college
    application, this is the first time i use VB and i am using VB-6 some
    of the reader who tried to help me in the past told me that this is
    not the proper place to be since it .NET but actually my problems are
    general and thats why i am posting again.
    from the MDI form i call lets say the student form, which is related
    to an access file where all the DB is held, the form takes the values
    it is asked to, but always for the student ID which is the first
    column, the first row is empty, eventhough if you open the access file
    the value is there, but on the form it doesnt show, while all the
    other values show, and therefore i get an error message about an empty
    field in my DB. any thoughts what would be the cause behind it?

    2nd question is, if i want to put 2 buttons 2 jump from the one row of
    the DB shown to the other, say next and previous, how would i do that?
    eventhough the mouse click does the job, but in case i want to hide
    the data table from the form i want a previous---next option to loop
    the Data

    3rd question, how can i make a text box, "show only" that you can not
    click on it neither edit it?

    Thank you all in advance.
  • Miro

    #2
    Re: DataBase and form problem


    "Totti" <saliba.toufic. george@gmail.co mwrote in message
    news:f31cb007-f52e-4baa-82de-9c3087658cc9@v2 2g2000pro.googl egroups.com...
    Hi everybody,
    VB.6 - I am working on a project that is actually a college
    application, this is the first time i use VB and i am using VB-6 some
    of the reader who tried to help me in the past told me that this is
    not the proper place to be since it .NET but actually my problems are
    general and thats why i am posting again.
    from the MDI form i call lets say the student form, which is related
    to an access file where all the DB is held, the form takes the values
    it is asked to, but always for the student ID which is the first
    column, the first row is empty, eventhough if you open the access file
    the value is there, but on the form it doesnt show, while all the
    other values show, and therefore i get an error message about an empty
    field in my DB. any thoughts what would be the cause behind it?
    >
    2nd question is, if i want to put 2 buttons 2 jump from the one row of
    the DB shown to the other, say next and previous, how would i do that?
    eventhough the mouse click does the job, but in case i want to hide
    the data table from the form i want a previous---next option to loop
    the Data
    >
    3rd question, how can i make a text box, "show only" that you can not
    click on it neither edit it?
    >
    Thank you all in advance.
    Hi Totti:

    I will try to help you out here. I'm still a newbie but I beleive I have
    gone through your headaches as well :)

    Question 1:
    Is the StudentID auto-increment in the Access Table ? Did you add that
    recrod from within .net?
    In .net an Access table's AutoIncrement field is not automatically populated
    back. You have to use something called @@Identity - but i have never gotten
    this to work - so what I do is I just re-query my table at the end of an add
    and get the id.
    Someone else here might be able to help you with that.
    My way is not the "Right" way of doing it - but it works and its such a
    small table I dont mind making a couple trips to the DB.
    SQL Express does it for you to get the new ID it assigned at the DB level.
    I use that simple way when I use an access table for stuff.

    Question 2: Take a look at the binding source. <
    bindingsource.m ovenext() / movelast .. (written in notepad )
    The binding source can be used to go up and down the records.

    Question 3:
    Textboxes have 2 options you can use.
    Enabled ( which grey's the control )
    or take a look at "ReadOnly"...th is does not grey the control but makes it
    so it is not editable.
    -Not every control has a 'readonly' property.

    Hope that helps.

    Miro

    Comment

    • Cor Ligthert[MVP]

      #3
      Re: DataBase and form problem

      Totti,

      What you are asking is all typicaly for VB6 as you use that..

      In VB6 are recordsets used (can also in Net), but VB6 you cannot use the
      ways .Net handles.

      So you really whould ask this in a VB6 newsgroup by example
      microsoft.publi c.vb.general.di scussion

      Cor

      "Totti" <saliba.toufic. george@gmail.co mschreef in bericht
      news:f31cb007-f52e-4baa-82de-9c3087658cc9@v2 2g2000pro.googl egroups.com...
      Hi everybody,
      VB.6 - I am working on a project that is actually a college
      application, this is the first time i use VB and i am using VB-6 some
      of the reader who tried to help me in the past told me that this is
      not the proper place to be since it .NET but actually my problems are
      general and thats why i am posting again.
      from the MDI form i call lets say the student form, which is related
      to an access file where all the DB is held, the form takes the values
      it is asked to, but always for the student ID which is the first
      column, the first row is empty, eventhough if you open the access file
      the value is there, but on the form it doesnt show, while all the
      other values show, and therefore i get an error message about an empty
      field in my DB. any thoughts what would be the cause behind it?
      >
      2nd question is, if i want to put 2 buttons 2 jump from the one row of
      the DB shown to the other, say next and previous, how would i do that?
      eventhough the mouse click does the job, but in case i want to hide
      the data table from the form i want a previous---next option to loop
      the Data
      >
      3rd question, how can i make a text box, "show only" that you can not
      click on it neither edit it?
      >
      Thank you all in advance.

      Comment

      Working...