Bob:
I believe the reason your encountering the error is that you are trying to
insert a value into an autonumber field in your SQL statement. Autonumber
fields generate their own value and cannot have duplicates. Therefore,
after the first insert the value 999 is already used, and any subsequent
insertions will fail and generate the error message you are receiving. I
was able to add to the combobox with the following modification to the SQL
statement.
strSQL = "INSERT INTO tbl_Outside_Referrals (OutsideReferral,
EmailReferralTo) " & _
"VALUES ('" & NewData & "','');"
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
"Bob Alston" <tu****************@cox.net> wrote in message
news:ycpaf.56557$fE5.6669@fed1read06...
David Lloyd wrote:
Bob:
It would be helpful to know the structure of your tbl_Outside_Referrals in
terms of fields, data types, etc. Also, knowing the property settings for
the combobox would be beneficial (Format, Column Count, Column Widths, Row
Source Type, Row Source, Bound Column, and Limit to List).
tbl_Outside_Referrals
seq Autonumber
OutsideReferral Text - 50 characters
Email Referral to Text - 50 characters
combo Box:
Combo10
Format Data Event Other All
Name . . . . . . . . . . . . .combo
Control Source . . . . . . . .OutsideReferral
Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Decimal Places . . . . . . . .Auto
Input Mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. . . .
Row Source Type . . . . . . . Table/Query
Row Source . . . . . . . . . .SELECT
[tbl_Outside_Referrals].[outsidereferral],
[tbl_Outside_Referrals].[OutsideReferral] FROM [tbl_Outside_Referrals
Column Count . . . . . . . . .2. . . . . . . . . . . . . . . . . . . .
.. . . . .
Column Heads . . . . . . . . .No . . . . . . . . . . . . . . . . . . .
.. . . . .
Column Widths . . . . . . . . 0";3.5209"
Bound Column . . . . . . . . .2. . . . . . . . . . . . . . . . . . . .
.. . . . .
List Rows . . . . . . . . . . 12. . . . . . . . . . . . . . . . . . .
.. . . .
List Width . . . . . . . . . .3.5208"
Status Bar Text . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. . . . . . .
Limit To List . . . . . . . . Yes
Auto Expand . . . . . . . . . Yes
Default Value . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. . . . . .
IME Hold . . . . . . . . . . .No . . . . . . . . . . . . . . . . . . .
.. . .
IME Mode . . . . . . . . . . .No Control
IME Sentence Mode . . . . . . None
Validation Rule . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. . . . . . .
Validation Text . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. . . . . . .
Visible . . . . . . . . . . . Yes
Display When . . . . . . . . .Always
Enabled . . . . . . . . . . . Yes
Locked . . . . . . . . . . . .No . . . . . . . . . . . . . . . . . . . . .
Allow AutoCorrect . . . . . . Yes
Tab Stop . . . . . . . . . . .Yes
Tab Index . . . . . . . . . . 2 . . . . . . . . . . . . . . . . . . .
.. . . .
Left . . . . . . . . . . . . .0.0417"