I'm really new with Acces and VBA, so all the help with code is greatly appreciated!
I created a form that kind of works like a switchboard (FRM_A) with two combo boxes [Organization (cbo_org) and Staff Initials (cbo_staff_init)]. Both boxes take the information from Table_A. This form has a “Search” button. See attached PDF file DB 1.
When I hit the “Search” button it will open a second form (FRM_B). Form FRM_B is supposed to open for the corresponding “Staff Initials”.
Form FRM_B has the following: 1 Text box for “Staff Initials”, 4 Combo Box , one is called “Activity Code” (cbo_Acode) which pulls the big list from a table called “Activity_Table”. The other 3 combox boxes are named : cbo_A, cbo_B, and cbo_C. All 3 combox boxes are just a “Yes, No, N/A” list.
Form FRM_B also has a List Box (Staff_Activity_List) and a “Save” button. See attached PDF file “DB 2”
How I want this to work is that once I select from the list from all 4 combo boxes, the “Save” Button will store the “Staff Initial”, plus the choices that were picked from all 4 combo boxes: “Activity Code”, “cbo_A”, “cbo_B”, and “cbo_C”. I also need this to store the information from the List Box to a Table (Table_B).
To summarize, the help I need on how to code all this are the following:
- How do I code that when I hit the “Search” Button in FRM_A it will open FRM_B with the record of the corresponding “Staff Initials” that were selected from FRM_A.
- How do I code that when I hit the “Save” Button it will store into the List Box (Staff_Activity_List) the “Staff Initial”, plus the choices that were picked from all 4 combo boxes: “Activity Code”, “cbo_A”, “cbo_B”, and “cbo_C”. Also, how do I make it so that it will also store that information into Table_B.
- And to follow up with the first question: How do I code that when I hit the “Search” Button in FRM_A, it will first look into Table_B and pull all the information that may stored already which corresponds to that “Staff Initial” and insert into the List Box so that when FRM_B opens it will list all the information saved for that “Staff Initial”. Otherwise if no information for that “staff initial” in B, it just opens a blank FRM_B.
1 1614 NeoPa 32,556
Expert Mod 16PB rakabuku: How do I code that when I hit the “Search” Button in FRM_A it will open FRM_B with the record of the corresponding “Staff Initials” that were selected from FRM_A.
In your DoCmd.OpenForm() call, pass a WhereCondition value (fourth parameter) that filters FRM_B on the value selected. rakabuku: How do I code that when I hit the “Save” Button it will store into the List Box (Staff_Activity_List) the “Staff Initial”, plus the choices that were picked from all 4 combo boxes: “Activity Code”, “cbo_A”, “cbo_B”, and “cbo_C”. Also, how do I make it so that it will also store that information into Table_B.
Generally you wouldn't.
You use Access to manage data entry for you. Trying to code around Access is not advised for anyone that would need to ask how to. Those of us that don't, generally would never do so anyway, but I never like to say never. rakabuku: And to follow up with the first question: How do I code that when I hit the “Search” Button in FRM_A, it will first look into Table_B and pull all the information that may stored already which corresponds to that “Staff Initial” and insert into the List Box so that when FRM_B opens it will list all the information saved for that “Staff Initial”. Otherwise if no information for that “staff initial” in B, it just opens a blank FRM_B.
Not sure what you're asking here, but for how to use forms to filter other forms have a look at Example Filtering on a Form. The concepts are the same but instead of applying the filter, when you have it set up, to the same form, you just apply it to the other one.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: John |
last post by:
Just a general question...
I'm currently using a combobox that when updated, opens a form with
its recordset based on a query using the combo box value as the
criteria.
I'm I correct in...
|
by: Craig Brown |
last post by:
I would like to open selected (Filtered) records in a form. I
currnetly have a custom menu but would like to only open certain
records from i.e
Button 1 will open Site 1
Button 2 will open...
|
by: nospam_stunter2001 |
last post by:
Hi folks,
I'm new here and am a neophyte Access 2000 user/developer. A year
ago, I barely knew what Access was. I was asked by the people that
pay us to begin keeping certain data about the...
|
by: KM |
last post by:
Is there a way to have a query open the corresponding form rather than
in datasheet view? I am creating a database that will run off of a
switchboard as the users do not know anything about access...
|
by: BLUE WATER |
last post by:
Allen, or others,
In my tables there is a unique key that identifies each new company record
with a number, this
variable is Company_ID as has been typed up in the edit table data view.
Thus I...
|
by: Julia Baresch |
last post by:
Hi everyone,
As some of you may know, we've been having trouble with an
unrecognized database format error.
Today I installed an unfinished project on the workstation of one of
my users. ...
|
by: Bob Sanderson |
last post by:
I have two forms, frmSearch and frmMain. I want to be able to enter a job
number in a text box on frmSearch and when I enter it, open frmMain and go
to the record for the job number I've entered....
|
by: Zlatko Matiæ |
last post by:
Hi.
How to check whether some form is open or not, in VBA ?
Thanks.
|
by: Mike D |
last post by:
If I have a project with 2 or more forms..
form(1) has a button to open form(2)
What is the code for opening for(2)?
Ex: form(2).show
This doesnt work. Simply anyways.
|
by: Young J. Putt |
last post by:
I have a vb.net datagrid bound to a dataview on a windows form. I want to
use the datagrid to display and filter a list of items, but since the data
is complex, I don't want the user to edit the...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| | |