Adding to a Database

Hi,

I'm pretty new to databases and I was wondering if somebody could help me with something. I have a DBList in Form6 which reads from a Data control in Form6. The DBList contains all the Names of people which are male (It has got this information from the Data control). Now, when you click on a name in the DBList it brings up all the other information about the person, this information goes into some labels.

In Form8 I have a few Text boxes, and a command button. I want 1 text box to contain the Name of the person who is currently selected in the DBList another to contain the NickName of the person selected and another one to contain the HomeTown of the person. Could anyone tell me how to do that?

The next thing I need help with is editing the selected record. What I want to do is edit the information in the Text boxes in Form8 and then, when I press a command button I want the record that is selected in the DBList in Form6 to update.

If you could help me I would be very grateful.

Thanks in advance.

Jared
http://simulatorcentral.cjb.net

Comments

  • I understood what ur trying to do, but u really framed ur question in a complicated way!

    To get all the data (nickname etc.) from the database, u could set up a query to retrieve only those records from the database which satisfy the 'name' criteria (the one selected in the DBlist).....
    ie, u'll have to create a recordset....

    [code]
    dim DB as database,RS as recordset
    set db=OpenDatabase("data.mdb");
    Set RS = DB.OpenRecordset("select * from where name=");
    [/code]

    now u can assign the individual fields to ur labels/text boxes.

    to update into the database just use the UPDATE sql command with the same DB object.

    [code]
    DB.ExecuteQuery("");
    [/code]

    easy??
    naaaaaah......its never easy!

    -sumedh


  • : What is the UPDATE command?
    :
    : http://simulatorcentral.cjb.net
    :

    its an SQL command....
    the words in UPPERCASE are keywords.....

    basic syntax:
    [code]
    UPDATE SET =[,=,......]
    [WHERE =];
    [/code]

    in your case u could use this like so:
    [code]
    UPDATE SET nick_name="wassup" WHERE first_name="john";
    [/code]

    hope that helps....
    why dont u download some code that helps u with what u want...??

    -sumedh
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories