Not in List problem

N

NoodNutt

Hi ppl,

I am using Acc2003, which I have just upgraded to from Acc97 (Finally).

I have this code in a combo which is in a subform

worked fine in Acc97, although this particular code wasn't used in a subform
configuration.

Appreciate any assistance or suggestions

TIA

Mark

Private Sub cmbContainer_NotInList(NewData As String, Response As Integer)

Dim db As DAO.Database, rs As DAO.Recordset, strMsg As String

strMsg = NewData & " is not listed ! Do you want to add it ?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Add New Container ?") = vbNo Then
Response = acDataErrContinue
Else
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblContainers", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!ContainerNo = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
End Sub
 
N

NoodNutt

G'day Douglas,

It is not adding the new item, 4 instance, if I add a new container no eg
AMZU0555658, and it's not in the list already displayed in the combo box,
the code should ask if I want to add it, alas it does not, first time I have
encountered this problem, it worked fine in Acc97.

Hinesight though, I have never used it on a subform, only a parent/main.

Another quirky thing about this particular combo is that when I type in a
container no, it automatically calls the first one alphabetically, by that I
mean, If I type in GCEU1111888, as soon as I type in "G", it will bring the
first "G" record, then dosn't allow me to continue typing the balance of the
container no.

Wierd one for me.

TIA.

Mark.
 
N

NoodNutt

Additionally, It has an input mask >CCCCCCCCCCC

thought I would just mention it.
 
D

Douglas J Steele

Sorry, I don't have Access 2003 installed on this machine, so I can't test
whether there's been a change in behaviour, but I think I would have
remembered if I'd encountered this problem in Access 2003!

Is this a case of an Access 97 application that you converted to Access
2003, or are you building a new application in Access 2003, and you're
copying the code you used previously in Access 97? The reason I'm asking is
because you may have forgotten to set the combobox up properly (setting its
LimitToList property to Yes)
 
N

NoodNutt

That fixed that prob, thx heaps Douglas & David

But I still have the problem of the cursor going all the way to the right
after I have entered the first Alpha and displaying the first matching alpha
record.

Thx again

Mark
 
D

Douglas J Steele

You should be able to continue typing, even if it's matched an entry. If
not, try backspacing.
 
N

NoodNutt

Douglas & David

David, yep, I fixed the LimitToList problem thanks.

Douglas, I am actually doing that now, though I have never had to in the
past, so I have no idead what is different in this instance. Generally, in
the past, I could continue typing over the top of whatever displayed whilst
matching data was inputted.

Also, I screwed up, although I am using Off20003, I noticed that the DB's
are in Acc2000 format, which is another thing I don't understand.

Will it have something to do with the jetengine?

Thanx heaps again guy's

Reg's
Mark.
 
D

Douglas J Steele

The default file format for Access 2003 (and Access 2002, for that matter)
is the Access 2000 format. This is to maximize the interoperability of the
database.

You can convert a single database to the new format under Tools | Database
Utilities, or you can change your default to use the new format (I think
it's under Tools | Options: sorry, don't have Access 2003 installed on this
machine)
 
N

NoodNutt

np, thx again Douglas.

Reg's
Mark.

Douglas J Steele said:
The default file format for Access 2003 (and Access 2002, for that matter)
is the Access 2000 format. This is to maximize the interoperability of the
database.

You can convert a single database to the new format under Tools | Database
Utilities, or you can change your default to use the new format (I think
it's under Tools | Options: sorry, don't have Access 2003 installed on
this
machine)
 
Top