I have a search form that searches for student ID from the student demographics table. I have it set when I click on the student ID (Frm_Student_Demographics_DailyCares) it will open the student visit form. When the student visit form opens it will show the student ID on the Student Visit Form but it is not being recorded in the student visit table.
I have Student ID control source on the Student Visit Form set as:
I have a form that displays a stock inventory, one of the fields I use is called [ItemCode].
On the Stock_Inventory form I have 10 command buttons that open other forms to display additional product information.
These were previously sub_forms that sat in a tabbed control box within the Stock_Inventory Form but as it now takes a while for the form to load (lots of queries running each time you search for a product) users are getting slightly frustrated.
So, what I decided to do, was move each subform from the tabbed control into a new form and open that form when it is needed by the user.
OK, when I open Stock_Inventory and search for a product [ItemCode = "ABC123"] and then want to see the Sales_History, I have to open my new form, Stock_Inventory_Sales_History, within this form are two sub-forms, each subform has a field called [ItemCode].
However, when Stock_Inventory_Sales_History opens it asks me to input the parameter [ItemCode] twice, I presume this is because the Stock_Inventory_Sales_History does not have a record source and that the subforms need [ItemCode="ABC123"] to run each query and return the data.
I need to pass the [ItemCode] from the Stock_Inventory form to each of the 2 Subforms that are on the Stock_Inventory_Sales_History form automatically.
I have the date set in the table and it shows up fine in the tblDate cell but doesn't pass through to the txttblDate in the form. I did have it working just fine until I rebuilt my database.
I know there are other threads on this but I have tried all the solutions and none have worked.
I currently have 2 forms, a customer form and a customer health form.
I want to pass the membershipNo from the customer form to a newly opened customer health form.
this is the code I am using but it isnt working, actually it is, but when i delete all the current customer entries and enter new ones it doesnt pick up the details and all the controls on the customer health form are greyed out.
Hi, i'm quite new to Access and I have a problem passing data from one form onto another.
I have a form that I use for quotations based on the table T Quotations on it I have: QuotationID as my primary RefCust referring to which customer Date and a few other fields
Now i'd like to add a button that when clicked will open my order form. In other words when a quote is confirmed I'd like to click on the quotation form to confirm it and create an order on the order form. Order form will open with a orderID autogenerated BUT will return the same RefCust as on the Quotation form, the same date and will give the quotationID as Refquote onto the new form.
Ex: on form quotation I have Cust: abc company QuotationID: 123 Date: Feb 25 2007 Quote: $300
when i click on confirm
the Order form will open with: OrderID: 002 (autogenerated) RefQuoteID: 123 Date: Feb 25 2007 (even though today might be April 10) RefQuote: $300
I have a function that when called transfers a query recordset to an excel spreadsheet then emails it. At the end of the function I use code to write the date sent to a table. Each time the function is called I only need records in the query that have been modified since the last time the function was called. I have a field in the query 'LastModified' with a criteria '>[Enter Date]'. I then look up the date in the table and enter it manually. I know how to look up the last date sent in table using code but getting the >#SomeDate# in the query with VBA.
I have a function in a module that looks like this (it takes 2 dates as arguments):
Code: Function get_KPIScanAgeRange(in_ScanDate As Date, KPIDate As Date) As String Dim ret As String ret = "Invalid" ' return value, by default is because age is negative number
[Code] .....
I'm trying to pass the date in a text box which exists in a form called "d3FormAging". The text box name is "KPIDate". The query looks like this:
Code: SELECT Query_d3_Open.[Company No], get_KPIScanAgeRange([Scan date],[Forms]![d3FormAging]![KPIDate]) AS KPIScanAgeRange, Count(Query_d3_Open.[Scan date]) AS Scans FROM Query_d3_Open GROUP BY Query_d3_Open.[Company No], get_KPIScanAgeRange([Scan date],[Forms]![d3FormAging]![KPIDate]) ORDER BY Query_d3_Open.[Company No], get_KPIScanAgeRange([Scan date],[Forms]![d3FormAging]![KPIDate]);
For some reason Access doesn't recognize the "[Forms]![d3FormAging]![KPIDate]" when I pass it to the function. I get run-time error 3070 with information that Access can't recognize this expression even though the code should be correct as it's made with the expression builder and I'm sure the form that contains the text box is open when the query runs.
I have a form called frmSchedule. Within this form, I have a combo box called cmbCD. I have code in the cmbCD NotInList Event. If the user inputs a number not in the list, the folowing code opens up a new form (frmPatients). The user can now add a new record to the database.
Code: Private Sub cmbCD_NotInList(NewData As String, Response As Integer) Dim Result Dim Msg As String Dim CR As String
CR = Chr$(13)
[Code] ....
I got this code and it works. However, when the user inputs a new number in frmSchedule, the NotInList event takes them to frmPatients. The users then have to re-type the number in frmPatients.
My question is: Is there a way I can trasfer the NewData from frmSchedule into frmPatients, so the users don't have to re-type the number?
I'm not sure if this should go in here or in VB Programming, because it's to do with an Access Database but it's VBA code. But I understand that VBA and VB are different in the way they work.
I think this may have been looked at before, but I'm not very good at using the search function. I've looked on google, but all I've seen doesn't seem to be for my use, so I came here as recommended by "RadioActive Frog" who I believe is a member here.
Right, basically, I am writing an Access database for my company's ordering system.
I have a form called "Enquiry" which has many tabs, one of these is the "client" tab in in here are many fields:
Firstname Surname Company Addressline1 Addressline2 Town County Postcode Phones Fax AltMobile Email ContactType
Now, there is an option to enter a new client or search the database for an existing client and it is basically the "new client" which I'm having issue with at the moment.
Basically, clicking the button "New Client" opens another form called "Client". Here, the user enters the data into fields which are the same as above (but on this contact form).
When done, they click a button called "Save and Close" which then asks the user if they want to paste their entered data into the original main "Enquiry" form.
It's this last bit, the transferring of this data I can't get my head around and would be incredibly greatful for help with.
My Code is below:
Code:Private Sub Save_Click()On Error GoTo Err_Save_Click ' On clicking save, a dialogue box will open asking if you want to paste this data ' into the enquiry form. Clicking yes will do this. Clicking no will just close the box 'declare intpress as an integer Dim SavePress As Integer 'Save Command DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'when save and paste is clicked, ask if the information should be pasted into the form or not SavePress = MsgBox("Would you like to paste this Contact Information into the Enquiry Form?", vbQuestion + vbYesNo, "Paste details") If SavePress = 6 Then 'If the enquiry form was the form which initiated the cotact form, then copy and paste 'the informtion into the enquiry form and the close the form 'If "Enquiry" = Me.OpenArgs Then <------ I have decided not to use this, as it doesn't seem to work. (I'm probably not using it correctly) Enquiry!FIRSTNAME = Me.FIRSTNAME Enquiry!SURNAME = Me.SURNAME Enquiry!COMPANY = Me.COMPANY Enquiry!CATEGORY = Me.CATEGORY Enquiry!ADDRESSLINE1 = Me.ADDRESSLINE1 Enquiry!ADDRESSLINE2 = Me.ADDRESSLINE2 Enquiry!TOWN = Me.TOWN Enquiry!COUNTY = Me.COUNTY Enquiry!POSTCODE = Me.POSTCODE Enquiry!PHONES = Me.PHONES Enquiry!ALTMOBILE = Me.ALTMOBILE Enquiry!EMAIL = Me.EMAIL DoCmd.Close acForm, "Contact" Else DoCmd.Close acForm, "Contact" End If Exit_Save_Click: Exit Sub
But It's not working. It's giving an error saying "Compile Error: Variable not defined" and it highlights the word which I've mad RED in the code above. Now, I tried changing the exclamation for a fullstop, and I also tried writing "Form.Enquiry.FIRSTNAME" (and also with exclamation marks). None have given a working result.
I'll try and get some print screens too for more visibleness (new made-up word there) so you can see what I mean.
I have a form where I do a search and find the correct auditor in the listbox from the AuditorTable. This form is opened from a master form where I have the same fields in the table (ClientTable). What I need is that when I find the one, I double click it and the records from that auditor is passed to the client table.how to use Dlookup.
I have a form with a date field, when the user creates a new record, I would like the date field to automatically fill with the most up-to-date date from the Orderdate table.
Basically I need the code to do the following when a new record is created;
Search the Orderdate table for the most recent date and then auto fill the date field on the form with that date!!!!
My thinking so far...
Private Sub Command34 - where would you set this event on the properties i.e. Before update or On Got Focus ?
Docmd.OpenQuery "QryFindMaxDate"
I'm not really sure how to pass the date to the text box on the form,
I have a form and in the subform for that I have a button that opens a pop up form. I want to pass the value [ACB ID] to an unbound text box in the popup form but I am having trouble. My code for the button in the subform is:
Currently when I press the button it asks me to enter the acb value instead of carrying it over. Also, when i do type in a number into the dialog, when the form opens, the text box is blank.
Anyway, I have a form that opens in datasheet view. It displays company names that exist on a client table based on a "Like" criteria the user typed into a text box. They type the word "network" in the text box, click search and a datasheet opens that has all companies that have "network" somewhere in the title. That's it. Works perfectly. We'll call this datasheet view form result "Test Query Form."
I have a second form that currently allows users to select a company from a drop down box and then populates the rest of the form with data from a table for that company. Again, works perfectly. We'll call this form "Existing Info."
I want to make a change to this second form. Rather than allow a drop down combo box for selection of the company, I want the "Test Query Form" to open the "Existing Info" form and automatically populate the form based on the company that the user double clicks on in the "Test Query Form." For instance, if I type in "network" and clicked search and got three companies with the word "network" in the company name, I want the user to double click on the second company name and have the "Existing Info" form open up with that second company on it and all the info populated for that second company.
I know this needs to be VBA code on the dblClick command for the company name cell on the "Test Query Form" but I can't quite get it to push the company name through to the "Existing Info" form.
How do I pass back a value to the calling form (i.e. 'FormA') from a form that is called (i.e. 'FormB').
'FormB' code stFormName = "FormB" DoCmd.OpenForm stFormName, acNormal, , , , acWindowNormal, strValue Msgbox strValue (This is the returned value 'FormB' code strValue = 'This is the passing value'
I have "LossForm" to record loss of inventory items due to damage, theft, etc. It has "Loss Subform" for input of multiple items. The row has a calculated field "TotalLoss" (from qty * itemcost). The footer of subform has unbound text field =Sum(nz([TotalLoss])). This all works fine. The problem I have is that I need to pass the total to another form. I want to have a pop-up form to use some of the field values from the Loss form. I have been able to pass all of the field values except for the TotalLoss.
pop up form: Set frmPrevious = Screen.ActiveForm Me.TransactionID = frmPrevious.LossID Me.EntryType = "Loss" Me.Date = frmPrevious.LossDate { Me.Amount = frmPrevious.TotalLoss doesn't work } DoCmd.Save End Sub
I also tried to setup a global, class, and module variable but keep getting error message of undefined variable.
I have a Form 01 that has staff names and the primary key StaffID. From this form, I want to open Form 02 to add a new record linked by the StaffID. How do I automatically populate the PK (StaffID) in Form 01 as the FK (StaffID) in Form 02?
Have one form that contains values AssociatedProject and AssociatedRelease that need to be passed onto another form that opens with a new record. Have tried different variations based on what I read here and couldn't get them to work.
Initial form - frm_ViewList contains the values that I need to pass on and has a "Add" button to bring up the new form that also creates a new record. The add button contains the following:
Dim stDocName As String MyAssociatedProject = Me.AssociatedProject MyAssociatedRelease = Me.AssociatedRelease stDocName = "Frm:ManageQuestionsAnswersProc" DoCmd.OpenForm stDocName, acNormal DoCmd.GoToRecord , , acNewRec
Then in the second form Frm:ManageQuestionsAnswersProc the following code is contained in the Before Insert:
I have several different sub-forms that have a button that opens a new form which creates a new record. Each of the different sub-forms have a field value that needs to be passed to the new record when the other form is opened. I've tried a few solutions, but to no avail. Right now I'm using the macro functionality as follows for one of the subforms:
The problem I think is that I'm creating a new record so the value doesn't get passed. The new record is only created after the user begins to enter data in the new form that was opened.
Have a form that contains fields AssociatedProject, AssociatedRelease and then the user hits a button to create a new record and a new form opens to display this newly created record which sets the fields and also sets a field called Type. There is no issue with setting the field values and the new record is created. However, when the form opens to display the record it displays another record instead (usually the one before it). I think it could be related to the fact that the db resides on a shared drive which periodically has slow connectivity. However, I'm looking for a solution, perhaps modifying the code?
Here's the code:
Private Sub Command17_Click() Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset Dim ctl As Control Dim varItem As Variant On Error GoTo Err_Command17_Click Set db = CurrentDb() Set rs = db.OpenRecordset("Tbl_Main", dbOpenDynaset, dbAppendOnly)
I have a database of experimental products. The database allows test technicians to input test information as well as product information (obviously in separate tables). Therefore before a tech logs test information, they have to first make sure the test product is in the database. They can do this by looking up the products that are in the database, and if the current one isn't they can input its information. In the lookup section you can also click on an individual product and lookup its test history.
What I am looking to do is add a button in the product information screen that allows the tech to open the test information input form with the test product information already loaded into the form. The product information portion of the test input form, is two combo boxes, one indicates the test products group and the other is the product number.
Looking up information on Google looks like i might need to use the OpenArgs function, however I have never used that before.
I get a negative value when i run the below expression.
The expression picks the month from the field txtmonth in form "frmYearToMonth" and search's the crosstab query "ctbYearToMonth" for the corresponding value in txtMonth.
I am new to access (2007), There is a datasheet in the form where we enter our time in/time out. We enter data using the form but that is one data at a time only. So I tried to paste multiple data (records) from excel into the access table. After pasting into the table, the data appears in the query, but not in the form.When I go to the form to check if the data I pasted into the table will appear in the form's datasheet...some data appears but some does not.
How to update data from one table to another table using form.
I have data coming from design team in Database 1 and using form i want search data and assign the job to a person and store it in the database with his name. I have to do this because database from design team is read only.
I have a form (called Form2) with say 3 text boxes, called txt_Field1, txt_Field2 and txt_Field3.
In txt_Field1 the user specifies the number of records to be added to an existing table. The fields txt_Field2 and txt_Field3 are used to pre-populate the records with default values.
Furthermore, I have set up a table called Table1. It's headers are ID, Strategy, divRate. ID is Autonumber, Strategy is Text, and divRate is Number.
Suppose the user inputs the following on Form2: txt_Field1 = 3 txt_Field2 = Covered txt_Field3 = 0.04
How do I programmatically add 3 records (since txt_Field1 = 3) to Table1 such that the table will look like: