Yes, DBGrid DataSource is set to Data1 and AllowAddNew is set to True.
This is the code I'm using when populating the combo:
If StockTable.RecordCount = 0 Then Exit Sub
Do Until StockTable.EOF
If IsNull(StockTable![Stock Code]) Then
StockLineCode$ = Space$(10)
StockLineCode$ = Left$(StockTable![Stock Code], 10) &
Space$(10 - Len(Left$(StockTable![Stock Code], 10)))
If IsNull(StockTable![Description]) Then
StockLineDesc$ = Space$(25)
StockLineDesc$ = Left$(StockTable![Description], 25) &
Space$(25 - Len(Left$(StockTable![Description], 25)))
If IsNull(StockTable![Sale Price]) Then
StockLinePrice$ = Space$(10)
StockLinePrice$ = Format$(Left$(StockTable![Sale Price],
StockListLine$ = StockLineCode$ & " | " & StockLineDesc$ & " |
" & StockLinePrice$
I have also had other suggestions on how to cure this like doing a
stocktable.movefirst after adding a record, and also this code:
If Not Adodc1.Recordset.BOF Then
ElseIf Not Adodc1.Recordset.EOF Then
But neither of these made any difference.
I would try to use the grid unbound but I don't know which commands to
use to manipulate the grid.
I appreciate you spending time helping me with this problem and look
forward to any further suggestions.
On Tue, 25 Apr 2000 21:38:14 GMT, Jim in Cleveland
>> I have a DBGrid control bound to an Access table. If I add a record
>> to this grid, close the form and fill an unbound combo box on another
>> form with the contents of the same table, the newly added record is
>> not shown.
>> Do I have to force the grid to write to the table somehow? It looks
>> as though it is storing it in memory as if I quit and restart the
>> program the data is there.
>> I have tried .rebind and .refresh in the lostfocus event of dbgrid but
>> they don't make any difference.
> Hmmmm. Is DBGrid bound to use a Data Control (i.e., DBGrid DataSource
>is set to name of a Data Control)? Is the DBGrid AllowAddNew property
>set to True? Cuz I just set up that scenario, added a record, then
>populated an unbound Combo box and the new record shows up, no problem.
>Could you please share the code you use to populate the Combo? Maybe
>problem lies there.
Servicecare Technology Ltd
Computer/fax/audio visual repairs
Bespoke software design
551 Warwick Road
Tel: +44 (0)121-707-6011
Fax: +44 (0)121-693-9940