Forms :: Opening A Form Based On Multiple Tables On A Specific Record
Dec 31, 2014
I have a form "frm_PatientNew" based on table "tbl_patients", this form contains a button "cmd_NewVisit" which is supposed to do the following: opens the form "frm_NewVisit" for recording a new visit for the last recorded patient in "tbl_Patients", I found many approaches depending on DMax and Dlookup and they worked fine just if "frm_NewVisit" is bound to "tbl_Patients", but "frm_NewVisit" is bound to "tbl_Main" which acts as a container for all information (patient data, visit data,service done and service provider), so the form "frm_NewVisit" contains fields from different tables. I wonder if I should create "frm_NewVisit" as unbound form, then adding fields from different tables to it and using vba to populate "tbl_Main",
I've done this dozen's of time - but it doesn't seem to be working now. I have a continuous form (frmHome) where i want a user to be able to click on a record, and be able to open up that specific record in "frmCustomer". The key field here is pkCustomerID (i have it in the query).
I have a form that displays details for a specific asset and a continuous subform that lists all the purchases for that asset. I have the following code in the On Click event for one of the fields in the subform:
Dim myOrder As Integer myOrder = Me.txtOrder DoCmd.OpenForm "frmOrders", acNormal, , "OrderID=" & Order, acFormEdit, , "Edit"
The problem is, when I click on any item in the subform, the code returns the value of the first item in the form rather than the one clicked on. If I open the subform on its own (outside the main form) then the code works fine. I can't figure out why it won't work in a subform.
But it returns every record for that agent and I want to be able to specify the date that goes with the name.
For example Tom has a record for Feb 10, Jan 10, and Dec 13. I only want to see the record for Dec 13.
I am able to see this in my form by having a combo box for the agent and the date (the date box being based on the agent box). So now how can I add a condition to include the date combo box?
Adding the condition gives me and type mismatch error, which I think may come down to the date combo box on the form having 3 columns (only 1 is visible).
I've initiated a log on procedure, with a password.
A user enters their ID and password. Once the correct password is entered, the next form is then loaded up, to which they make some choices.
My problem is that I have lots of users, and I would like them to only access the page that is relevant to themse, and NOT be able to see anyone elses.
I gather there is a little bit of tweaking to go on the docmd.openform...
line, and somehow incorporate the userID, but not entirely too sure what it is.
I have a Calibration form, with a button on it that links to an Equipment Inventory form. In the Calibration form, you choose the instrument you want to calibrate from a combo box (which in turn automatically selects the barcode number for the instrument in another combo box), then if you need to edit info on it (ie. serial number), you click the button
Now, I need the Equipment Inventory form to open to the record that matches the bar code in the second combo box
I have a table that has two forms linked to it - one is the Main Form which is used to input the data for the bulk of entries, however on some entries there will be some additional data required which the other form (lets call it Time Form) takes care of.
What I would like to do is have a button on the Main Form that opens the Time Form, and then go to the specific record that is open on the Main Form;I have an ID field (Autonumber + Primary Key) which displays in a text box on the main form, and it would provide the number of the record for the second form to open.
My problem is that I am trying to update a field (called 'Sold' which is a yes/no checkbox column) for a specific record whenever an event is triggered. I have two forms (derived from two tables), one is called frmInventory and the other is called frmSales. In frmSales, I made a combo box called 'cboItemID' that allows the user to select from a list of items from my inventory table. Each selection from the list has 4 properties, the first of which is the 'Item ID' from the inventory table. Lastly, I have a field in both frmSales and frmInventory called 'Sold' as mentioned above. What I want to do is that whenever I check/uncheck the box in the 'Sold' field in frmSales, I want the 'Sold' field in frmInventory to check/uncheck as well, but only in the record with an 'Item ID' that matches the 'Item ID' from the combo box selection. In other words, I want to match the 'Sold' field in frmInventory with the 'Sold' field in frmSales, but for only the record that has the same 'Item ID' primary key as the one I picked from my selection in the combo box from frmSales.
how to reference another table and check whether or not it's 'Item ID' primary key is identical to the one I specified from the combo box, and then take action to update the 'Sold' field if the IDs match.
I have a master form for lack of a better phrase and 3 other forms that represent specific items in the original drop down box. In the master drop down box, I have all 50 states, and the 3 forms are for 3 specific states. Here's the code I have so far but when I save, it says "The 'OpenForm' macro action has an invalid value for the 'Where Condition' agrument."
Option Compare Database Option Explicit Private Sub State_AfterUpdate() Select Case Me.State Case "CA" DoCmd.OpenForm "Auditor Form (CA)"
All my records are displayed on a form. Upon clicking on their respective 'View' button, I would like to open that particular record. How can I do that? I have attached a screenshot for better clarity. Thanks in advance for the help!
I want to hyperlink from a query direct to the relevant record in a specific form. I have a hyperlink field in the form which shows up in the query. When clicked in the query, this hyperlinks to the form but I cannot make it select the correct record in the form.How do I get it to select the correct record?
I seem to need some help! I have a table with customer information in it ie: name, vehicle, (Key=Id number)... it is the master link to the repair table ie: mileage, (Key=ROnumber), and repair data.. these two work together beautifull now I need to add another table, a check sheet for checking over a vehicle. I create the table and the form however I cannot open a new form with the ROnumber from the second already open form into the newly open form. (the second form is based on a Query, and I have tried changing it to a SQL statement both with no luck) is there an example of what I need to be doing to link the ROnumber to the ROnumber in the new form, or create the ROnumber so it will add the data in the linked table? I need this to open using a button on the open repair form David
Each table has a corresponding form for data entry in each area. The tables were subdivided in this way in order to limit each department's ability to edit the data of other departments. The only field common to each table is the drug lot number, or "Lot #" (which is the primary key of each table).
I wanted to make it so that when Manufacturing enters a new lot number on frmMFGData, it automatically creates that lot number in the other 4 tables. This process mirrors our actual real world business process, where drugs are manufactured and assigned new lot numbers by our manufacturing team, and then other departments simply reference those numbers when doing their part.
To accomplish this, I went ahead and set up 1 to 1 relationships between the various tables using their "Lot #" fields, establishing referential integrity and enabling cascading updates. However, when I attempted to enter a new lot number into frmMFGData (the manufacturing form), it didn't seem to appear in any of the other tables. If I edit an existing lot number and change it to something else, the change does carry over to the other tables, so I know that the cascading updates are working in some capacity.
If cascading updates cannot "cascade" new records, then is there any other way to accomplish this?
I have two tables and two separate forms. [ID] is the link between them. (I cannot do a subform in this case).
Form1 displays 3 records
Have control button that goes to Form2 where [id] = NumID (NumID is "long" variable)
Have control button on Form2 to go back to Form1. It needs to go to the same record it came from. I don't want use a where clause (e.g., where [id] = [id]). This works, but the form1 is now filtered. I need all records available in Form1, but I want to go to the record it was on when the button was clicked to go to form1
I am building a form to create a user record and at the same time i have some yes/no options which are located in other tables but when i want add a user i cannot select any yes/no options they seem locked?
I have a form that displays customer account information. The form is connected to two tables. each customer has their own account number that i use to lookup their information. right now i have to click on the account number field and click find to pull up the record. I have built a popup form that displays the customers names with their respcetive accounts. My question is, How can i use the popup form to select a customer name and have the main form goto that record without using the find button.
I wish to open a form based on the transaction table populate one of the foreign key fields with a selected value from a combo box from the switch board (with going to a mainform&subform). I know how to get the value of the combo box on the switchboard. I just know how to then store this value in the foreign key field. stSelectedCustomer = Forms![Switchboard].[CustomerID] gives me the value from the combo box on the switchboard. I then want to open the transaction form to open a new record and have Customer ID on this form be the stSelectedCustomer storing this value in the transaction table when the user enters values in the other fields.
I'm trying to get a combo box & button to work together. On the main form of the attached database, I just want the button to go to the associated record based off my selection (or entry) in the combo box.
I've tried the following:
- Looked through the Northwind sample database for a close example. Tried my best to replicate the functions but it didn't work - Looked through other examples posted and tried to manipulate the code to no avail - Tried using [Forms]![Main Form]![cmbLastName] in both the filter & criteria section of the macro
The user select the class from [Combo28] for the unit already in [Textbox named Unit] from Form 1 and wants to list all the students for that particular class and unit in form 2.
I have tried god knows how many different codes. I've been playing with:
I have created a database with a switchboard and a form ("RMA"). Currently, on my "RMA" form I have a command button that allows the user to find a specific record by entering an RMA number into an input box. My code is as follows:
Private Sub cmdFindRMA_Click() Dim myFilter as String If vFindRMA = "" Then 'vFindRMA is a global variable, string. vFindRMA = InputBox ("Enter the RMA Number to find:", "Find RMA", "", 5000, 3000) myFilter = "[RMA_Number]='" & vFindRMA & "'" Me.Filter = myFilter If Me.Filter = "" Then Me.FilterOn = False Else Me.FilterOn = True End If End If vFindRMA = "" End Sub
I want to be able to remove this command button from my RMA form and add it to my Switchboard. My problem is, I don't know what code I need to use in order for it to work from the switchboard. Can anyone help?
My report produces multiple copies of the same record. I know why, but don't know how to fix it.
EmployeeTable.
With a one to many relationship with TrainingTable (via employee PK as FK in trainingtable).
Training table has a one to many relationship with a table called Range.
Report is based on a query that picks up the Employee/Training/Range (range just describes the training unit).
However, If I have more than one range expressed organized a training unit, the report spits out several copies of the Employee record to display all the ranges.
I have a continuous form for which the recordsource is a query that retrieves dates from 10 days in the past to 10 days in the present. I want the record with today's date to be at the top of the form. The record with the oldest date is always on top. Is this a scrolling issue? How can I get the record with today's date to appear on top?
I have a table with a schedule of tasks that are required weekly for the next year. Each record has Monday's date as the Scheduled_Date" for the task. From my main form, I have a command button to open a form linked to the table, so that amendments can be added to the table for each record (i.e. - If a task is complete/incomplete/progressing etc. the user marks it so.
What I would like to do is have the form open at the task scheduled for the current week, based on the "Scheduled_Date" value. Whilst I can do this with a simple filter, I would like the form to open with all records available to the user so that they can go forwards/backwards as they wish, but the first record they see when the form opens is the one specific to this weeks date.
I have a form with a subform. Every time I open the form I want it to open to a new record in the subform (but not necessarily a new record in the main form; that will depend on some other stuff that I've already taken care of).I found a way to do that using the following VBA in the main form:
Private Sub Form_Current() Me.EventSubform.SetFocus DoCmd.GoToRecord , , acNewRec End Sub
It works great, but it causes Access to automatically scroll down to the start of the subform, blocking the view of information in the main form that the user needs to see. I've tried adding a line to Form_Current() to reset the focus to the main form but it doesn't seem to work.
I have a list of client stored in a table "Clients". I would like a form to present a user with the next client in the list at the click of a button, but there will be some exceptions:
Some clients will be given priority, and should be moved to the top of the list although they may not be the next logical entry in the table. Priority clients are indicated by a field "Priority" with a Yes/No option set before work begins.
Some clients will have requested a call at a certain time of the day - This time will be stored in a field named timeToCall. The next user to click the button after the time has passed should be given that clients details.
When the end of the list is reached any clients who could not be contacted will be tried again. My table currently has a field "Attempts" to track this, but that may not be needed. Clients who have been dealt with will be removed from the "Clients" table to a "Completed" table.
Whichever record is selected will be flagged as being dealt with so that 2 people don't get the same entry. I may add a new field for this, but right now I plan to use the "attempts" field to control this
I am unsure of the best approach to the above, I'm not very well-versed in Access, but if I were doing this in Excel (as originally requested by my boss) I would do it like this:
Use a form where the "Next" button will use VBA code to first check if there are any priority clients, then check if there are any timed client's ready to call and then move to the next entry that has had 0 contact attempts. Whichever record is the next one will be displayed in the form to the user.
My db has several tables tb1, tb2 tb3 tb4 ..... I have link tb1 to tb2 (tb1Id to tb2)and linked tb2 to tb3 and tb4 (tb2Id to tb3 and tb4) I have created a form with several field from tb1 and tb2 and a single field for tb3 and tb4. All of the fields except one for tb1 are use to make a decision based on what they display. The only field that is updated on the form is a date conversion field from tb1. once you update this field it will auto populate a date field on tb1 with current date. you then have a choice of 4 commands to activate based on what is displayed form the rest of the form.
my problem none of the fields can be updated. can any one help
qry the form is based on
tb1 [Name] tb1 [ID] tb1 [date conversion] 'this is the only field that is manualy updated tb1 [date] 'updated base on date conversion field being updated tb2 [field] tb3 [Yes/no] tb4 [yes/no]
based on what is displayed on the form you have 4 choices of cmd buttons.