I'm trying to use the NotInList event on my 'cultures' form to open an
'addNumber' form, use 'addNumber' to add a number to the underlying lookup
table, then return to the main form. Here is my sticking point:
DoCmd.OpenForm addNumber, acNormal, , , acFormAdd, acDialog, NewData
This command opens the 'addNumber' form, and allows user to fill in the
desired number (and subsequent fields), but I can't seem to get the NewData
argument to pass to the form. I've tried all types of contortions with the
events associated with the 'addNumber' form to populate the txtNumber text
box with the NewData value. When I set a break point within the 'addNumber'
form I see that NewData = 0, but when I look in the 'cultures' code NewData
has the value typed in by the user.
When I remove acDialog from the .OpenForm command I can manipulate the text
box value and set it appropriately with the following:
DoCmd.OpenForm addNumber, acNormal, , , acFormAdd, acDialog, NewData
Forms!addNumber.txtNumber = NewData
Of course, then I have problems getting the combo box to requery when the
'addNumber' form closes.
Any ideas?
SteveS - 29 Mar 2005 14:45 GMT
> I'm trying to use the NotInList event on my 'cultures' form to open an
> 'addNumber' form, use 'addNumber' to add a number to the underlying lookup
[quoted text clipped - 20 lines]
>
> Any ideas?
Paste this in the FORM 'addNumber' OnOpen event:
Private Sub Form_Open(Cancel As Integer)
Me.txtNumber = Forms!addnumber.OpenArgs
End Sub
--
SteveS
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
Michael Mac - 29 Mar 2005 22:57 GMT
> > I'm trying to use the NotInList event on my 'cultures' form to open an
> > 'addNumber' form, use 'addNumber' to add a number to the underlying lookup
[quoted text clipped - 32 lines]
> "Veni, Vidi, Velcro"
> (I came; I saw; I stuck around.)
Thanks, Steve S
I gave the above a whack, no luck...then I put it in the load event for the
form and changed the period to an exclamation point & success. I wouldn't
have gotten there without your help.
Private Sub Form_Load()
Me!txtNumber = Forms!addnumber.OpenArgs
End Sub
Wooo Hooo (I'm easily amused)!!
Michael Mac
SteveS - 30 Mar 2005 04:53 GMT
> Wooo Hooo (I'm easily amused)!!
> Michael Mac
;-D
Sorry about the dot/bang... the company just converted to Off 2003 :-(
and strange ting r happenin #$^&^$% ... <g>... don't like it one bit (or
byte)!
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)