Can't Add Record To Table.

Results 1 to 2 of 2

Thread: Can't Add Record To Table.

  1. #1
    Lonn Guest

    Default Can't Add Record To Table.

    Hi, I&#039m having a problem adding new records to a table called "Member Table". This is in an Access97 Database. (I&#039m working on a database that someone else created and they are not around to ask.)<BR><BR>The [Members] Table basically has [Name],[Alias],[Ethnic] as fields.<BR><BR>Now, the Look Up Value, for the field [Ethnic] is a combo box with row source as follows...<BR><BR>SELECT DISTINCTROW [Ethnic List].[Ethnic ID], [Ethnic List].[Race] FROM [Ethnic List];<BR><BR>So the Member.Ethnic gets it&#039s value from the [Ethnic List] Table.<BR><BR>My problem is as follows. I&#039m trying to add a new Member to the [Member] table, but don&#039t know what to do about the value of the "ethnic".<BR><BR>This is the code snippet that I&#039m having the problems with.<BR>assume connection is okay etc.<BR>&#039--------------------------------------------------<BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>rs.Open "SELECT * FROM [Models List];", cnn, adOpenKeyset, adLockPessimistic, adCmdText<BR><BR><BR>rs.AddNew<BR> rs.fields("Name") = tmp_name<BR> rs.fields("Alias") = tmp_alias<BR> rs.fields("Ethnic") = XXXXX &#039 I don&#039t konw what to put here.<BR>&#039--------------------------------------------------<BR> ^<BR>what should I put here??-^<BR><BR><BR>[Ethnic List] looks like this.<BR><BR>[Ethnic ID]-&#124-[Race]<BR>1-----------&#124-Chinese<BR>2-----------&#124-Japanese<BR>etc.<BR><BR>I know it&#039s kind of confusing, I tried to include as much information as I thought would be needed. Thanks for your time in advance.<BR><BR>Lonn.<BR>

  2. #2
    LONN Guest


    I fixed my problem. Sorry to make you read the previous message.<BR><BR>Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts