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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

it insert the form data in a table twise

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
when i execute the following code by press add button and go to Customers Table , I find two records inserted with same data but into two rows with differnt identity

in my form there is a radio buttons and when i insert the data as record in Customers table, a two records inserted and in the first record the value of radio button field is the option value number and in second the string value as i need.

help me to solve the problem and only insert one record not two


The code is:

Set rst = dbs.OpenRecordset("Customers")

With rst
.AddNew
!CustomerID = CustomerID
!CustomerName = CustomerName
!CustomerAddr = CustomerAddr
!CustomerTel = CustomerTel
!CustomerFax = CustomerFax
!CustomerMail = CustomerMail
!City = City

.Update
End With
rst.Close
 
hi,

hope you didn't use bound controls in your form? if so, make them unbound or delete the code...

grtz

cpuburn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top