copy text box value from current form to "Next" form

  • Thread starter dcc15 via AccessMonster.com
  • Start date
D

dcc15 via AccessMonster.com

I am creating a DB to handle/record a process that has basic information
(Table1), I have a data entry form (Form1) for this table/information that
includes a “ID1†field (stored "ID1" is TEXT and generated by VBA code
“beforeinsert†and is unique/key). I would like to have command buttons (at
least 3) on this form that will when selected (clicked):
1). Mark a corresponding Yes/No box in “Table1†(“ReqAction1aâ€) to “True†for
later querying (not visible on form).
2). Then copy the value in “ID1†from “Form1†(for relating tables, one to
many and user reference).
3). Open “Form2†(data entry form for Table2) and paste/insert the copied
value to textbox “ID1†on “Form2â€. This will be the value for table
relationship(s). “ID2†will be code generated for unique record ID in Table2.
4). Close “Form2â€.
NOTE 1: Data properties in the form textboxs for “ID1†and “ID2†are set to
Enabled= No and Locked= Yes, this is to prevent editing in the form(s).
NOTE 2: Table and field names are not actual names (avoid using numbers in
table/field names).
NOTE 3: Have been using a “Flat File†for managing this data but have
completely out-grown it’s capability/practicality, so this will be my first
true relational DB.
NOTE 4: I am spanking new to VBA code writing (was using Macros but would
like to avoid them in this DB).
Any help/guidance would be greatly appreciated.

DCC
 
D

Dorothy

I am creating a DB to handle/record a process that has basic information
(Table1), I have a data entry form (Form1) for this table/information that
includes a "ID1" field (stored "ID1" is TEXT and generated by VBA code
"beforeinsert" and is unique/key). I would like to have command buttons (at
least 3) on this form that will when selected (clicked):
1). Mark a corresponding Yes/No box in "Table1" ("ReqAction1a") to "True" for
later querying (not visible on form).
2). Then copy the value in "ID1" from "Form1" (for relating tables, one to
many and user reference).
3). Open "Form2" (data entry form for Table2) and paste/insert the copied
value to textbox "ID1" on "Form2". This will be the value for table
relationship(s). "ID2" will be code generated for unique record ID in Table2.
4). Close "Form2".
NOTE 1: Data properties in the form textboxs for "ID1" and "ID2" are set to
Enabled= No and Locked= Yes, this is to prevent editing in the form(s).
NOTE 2: Table and field names are not actual names (avoid using numbers in
table/field names).
NOTE 3: Have been using a "Flat File" for managing this data but have
completely out-grown it's capability/practicality, so this will be my first
true relational DB.
NOTE 4: I am spanking new to VBA code writing (was using Macros but would
like to avoid them in this DB).
Any help/guidance would be greatly appreciated.

DCC

Hello. Here are some suggestions. I hope they work for you.

1.) Create a field in Table1 that's a yes/no field. Then write an
AfterUpdate code in Form1 that updates this new field based on
whatever criteria you have in Form1 or based on the click of the
button. (You can also use check boxes if you'd like; so when the box
is checked, it's "Yes" and when it's not checked it's "No".)
2.) Create a query that pulls the "ID1" field from Table1 into Form2.
If Table1 is already the source for Form2, then you just need to pull
in that field. You can create a button in Form1 with the wizard that
opens Form2 with the data you just entered from Form1 into ID1.

Good luck!

Dorothy
 

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