AutoFill On The New Record On NotInList?

  • Thread starter Faraz Ahmed Qureshi
  • Start date
F

Faraz Ahmed Qureshi

When on Form_1's combobox Field_1's NotInList event the Form_2 opens I want
its field Field1 to be reflecting the new entry I had inserted in the
Form_1's Field_1.

What would be the appropriate piece of code in this record?
 
A

Allen Browne

Requery the other combo after you add the new record.

This kind of thing:
Forms![Form_2]![Combo23].Requery
 
F

Faraz Ahmed Qureshi

Nice 2 hear from u Allen!
However, I think I was not clear.
Form_2's Field_1 is a TextBox.
In simple language and another example:

In my form Orders (Form_1) when I insert a new salesperson's name in the
combobos (Field_1), I want to have the Emplyees' Form (Form_2) to be opened
in add mode with its Employees_Name Field a TextBox (Field_1) filled up with
the new entry I had inserted in the Form_1's Field_1 ComboBox.
--
Thanx & Best Regards,

Faraz!


Allen Browne said:
Requery the other combo after you add the new record.

This kind of thing:
Forms![Form_2]![Combo23].Requery

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Faraz Ahmed Qureshi said:
When on Form_1's combobox Field_1's NotInList event the Form_2 opens I
want
its field Field1 to be reflecting the new entry I had inserted in the
Form_1's Field_1.

What would be the appropriate piece of code in this record?

.
 
A

Allen Browne

So you want to pop up a form where the new entry can be added?

Take a look at:
Adding values to lookup tables
at:
http://allenbrowne.com/ser-27.html

The article explains 4 ways to do this.

In practice, it may not be as simple as passing the value from the combo to
the other form. Typically people have an autonumber (say EmployeeID), which
is the key value for the lookup table, and is the foreign key value for the
combo (even though the display value is the name.) It is possible to pass
the NewData to the target form, but then you may need to clear it from the
combo for it to work as expected.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Faraz Ahmed Qureshi said:
Nice 2 hear from u Allen!
However, I think I was not clear.
Form_2's Field_1 is a TextBox.
In simple language and another example:

In my form Orders (Form_1) when I insert a new salesperson's name in the
combobos (Field_1), I want to have the Emplyees' Form (Form_2) to be
opened
in add mode with its Employees_Name Field a TextBox (Field_1) filled up
with
the new entry I had inserted in the Form_1's Field_1 ComboBox.
--
Thanx & Best Regards,

Faraz!


Allen Browne said:
Requery the other combo after you add the new record.

This kind of thing:
Forms![Form_2]![Combo23].Requery

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


in
message news:[email protected]...
When on Form_1's combobox Field_1's NotInList event the Form_2 opens I
want
its field Field1 to be reflecting the new entry I had inserted in the
Form_1's Field_1.

What would be the appropriate piece of code in this record?

.
 
F

Faraz Ahmed Qureshi

MAN!!!
Allen your site sure is a collection of priceless treasure!
THANX!!!

--
Best Regards,

Faraz!


Allen Browne said:
So you want to pop up a form where the new entry can be added?

Take a look at:
Adding values to lookup tables
at:
http://allenbrowne.com/ser-27.html

The article explains 4 ways to do this.

In practice, it may not be as simple as passing the value from the combo to
the other form. Typically people have an autonumber (say EmployeeID), which
is the key value for the lookup table, and is the foreign key value for the
combo (even though the display value is the name.) It is possible to pass
the NewData to the target form, but then you may need to clear it from the
combo for it to work as expected.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Faraz Ahmed Qureshi said:
Nice 2 hear from u Allen!
However, I think I was not clear.
Form_2's Field_1 is a TextBox.
In simple language and another example:

In my form Orders (Form_1) when I insert a new salesperson's name in the
combobos (Field_1), I want to have the Emplyees' Form (Form_2) to be
opened
in add mode with its Employees_Name Field a TextBox (Field_1) filled up
with
the new entry I had inserted in the Form_1's Field_1 ComboBox.
--
Thanx & Best Regards,

Faraz!


Allen Browne said:
Requery the other combo after you add the new record.

This kind of thing:
Forms![Form_2]![Combo23].Requery

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


in
message When on Form_1's combobox Field_1's NotInList event the Form_2 opens I
want
its field Field1 to be reflecting the new entry I had inserted in the
Form_1's Field_1.

What would be the appropriate piece of code in this record?

--
Thanx & Best Regards,

Faraz!

.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top