> I have a table retailers...this has information on the retailer only
>
[quoted text clipped - 4 lines]
> and a table Orders with the following fields....OrderID, Retailer,
> referenceNO
I suggested one schema design...
Having a table for every coupon even before it is sold on is possible, but
my instinct would be to create it when it's returned to you. At that point
it becomes a Sale, before then it's just one of a Batch passed to a
Retailer. Generally speaking, creating a large number of rows in a table
just for the sake of having them is a Bad Idea. In any case, the fact that
coupons 20950 to 20999 were sold to Acme Coupons is One Fact (not fifty
facts) and therefore ought to be recorded in One Field.
In the end, either solution has its advantages and its drawbacks, and only
you know enough about your business needs to evaluate them.
Best of luck
Tim F
Janet - 29 Nov 2004 14:33 GMT
yes this is a great suggestion thank you. Here is how I accomplished this
task as I needed, I thought I'd post it in case someone else is wondering how
to add multiple records at one time. Now I just need to figure out how to
add different code so that I can move the database around without a problem.
Private Sub btnsave_Click()
On Error GoTo Err_btnsave_Click
Dim adoConnection1 As ADODB.Connection
Dim adoRecordset1 As ADODB.Recordset
Dim connectString1 As String
'—Create a new connection --
Set adoConnection1 = New ADODB.Connection
'—Create a new recordset --
Set adoRecordset1 = New ADODB.Recordset
'—Build our connection string to use when we open the connection --
connectString1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=C:\Documents and Settings\folder\db.mdb"
adoConnection1.Mode = adModeReadWrite
adoConnection1.Open connectString1
adoRecordset1.Open "tblReference", adoConnection1, , adLockOptimistic
Dim Range As Integer
Range = CInt(Form_frmAssignOrderNo.Text6)
Do While Not adoRecordset1.EOF
If adoRecordset1!ProductSold = False Then
Dim x As Integer
For x = 1 To Range
adoRecordset1!ProductSold = 1
adoRecordset1!OrderID = Form_frmAssignOrderNo.OrderID
adoRecordset1.Update
adoRecordset1.MoveNext
Next x
MsgBox (Range & " Reference Numbers added")
GoTo CloseRex
End If
adoRecordset1.MoveNext
Loop
CloseRex:
adoRecordset1.Close
adoConnection1.Close
Set adoRecordset1 = Nothing
Set adoConnection1 = Nothing
End
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_btnsave_Click:
Exit Sub
Err_btnsave_Click:
MsgBox Err.Description
Resume Exit_btnsave_Click
End Sub
"> I suggested one schema design...
> Having a table for every coupon even before it is sold on is possible, but
> my instinct would be to create it when it's returned to you. At that point
[quoted text clipped - 10 lines]
>
> Tim F