Passing Data Through Forms

Feb 24, 2006

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.

Private Sub cmdCustHealth_Click()

DoCmd.OpenForm "CustomerHealth", , , "[MembershipNo] = " & Forms!CustomerForm!membershipNo, , acDialog

End Sub

The control source on the text box on the customer health form is "membershipNo" where am I Going wrong?

View Replies


ADVERTISEMENT

Forms :: Passing Data From A Form To A Table

Jul 5, 2013

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:

=[Forms]![frm_SearchStudent_DailyCares]![Frm_Student_Demographics_DailyCares].[Form].[SD_Record_ID].[Value]

My tables are called Student Demographics(parent table) and Student Daily Cares(child table) and they are linked by Student ID.

I have done this before on another part of this database but I just simply can't seem to find what I missed.

Here is a sample of my forms and tables.

View 2 Replies View Related

Forms :: Passing Text Box Data To A Function Via A Query

Jan 28, 2014

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.

View 2 Replies View Related

Forms :: Stock Inventory - Opening Form And Passing Data

Jan 9, 2014

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.

View 4 Replies View Related

Passing Data Between Tables

Feb 8, 2008

I have a bit of a dilemma in my related tables (screen shot of relationships attached).

Basically at the moment I am using a 1-1 relationship between my tables using the primary key of CYID. The CYID is populated using an auto number at the moment but the problem I have is if the tables become out of sync with the numbering.

What I would like to do is when I create a new record in tblClientDetails is create a new record in each corresponding table that is linked and then pass the CYID across to each table. Can anyone offer any assistance or give me any suggestions for better ways of doing this?

View 2 Replies View Related

Passing Data Via DDE To Access

Mar 21, 2007

I'm trying to pass data from a macro using DDE to Access (it must use DDE), however, I can't seem to get the data to a Module, Macro or Form (either one will do).

Is there a way to pass arguments to any of these three? I'd imagine the easiest would be to run a macro like DDEExecute channel1, "[RunMacro MyMacro]" but how can I pass the data specifically do the Macro?

View 5 Replies View Related

Passing Data Onto Another Form

Apr 11, 2007

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

Please help me

View 1 Replies View Related

Passing Form Data To An Sql Query

Nov 15, 2005

I have a hidden field on my form called "key". I can reffer to it as [forms]![MyForm]!key Is that right?

I also have a subform on this form that uses an sql query. I want this query to match on the key from above.

Shouldn't this work? select field1, field2 from table1 where keyvalue = [forms]![MyForm]!key

It doesn't. It returns a blank record.

Any help would be greatly appreciated.

View 1 Replies View Related

Modules & VBA :: Passing New Data From One Form To Another

Jan 19, 2015

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?

View 2 Replies View Related

Passing Parameter From A Data Access Page.

Jul 28, 2005

Hi - I am looking for some help understanding the instructions in the msdn article on how to pass a parameter from a DAP. Please refer to the article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k2/html/odc_PassParam.asp


I was able to follow the instructions until Page 2 of this article...where it says: "Add the functions to write, read and delete cookies in a separate global script block."

I do not understand how to create a global Script block. Do I just copy and paste this code right below the 1st code on Page 2? Or, is there a way to create a global script block separately and add this code there?

I am unable to find that much Online resources on DAP as other Access topics. I thought posting my question here would be the last resort for assistance! :confused:

View 3 Replies View Related

Date Format When Passing Data To An Email

Aug 31, 2005

I have a button on a form that creates an email and inserts fields from my database. I have a field that is set to Long Date format type, but when it populates the email, it shows as a Short Date format type. Is there anyway to retain the Long Date format?

View 1 Replies View Related

Data Succession-passing Db Tables To New Operators

Feb 23, 2006

I am preparing a database application that will be used by one person in an organization. Frequently , (every year or two) the program will be given to another (usually a laptop) user in the organization as that person assumes the task of the program’s operation and responsibilities.

I would like the user to load the program from the installation CD (made with Wise Installation System and SageKey softwares) on each computer each time there is a brand new user and each time a subsequent user takes over. However, each successive user needs to have the data files passed from the last user.

At face value it seems that having a front end/back end arrangement might be the most desirable. Can anyone jump start me on the best way to accomplish this process to EZ data transfer?

Thanks in advance to all,

JQ

View 1 Replies View Related

Reports :: Passing Data To Report From A ListBox

Mar 14, 2013

How can I pass data (an employee's first and last name) to a report ? I captured the employee's name from the listbox, but can't seem to pass it to the report. The desired report will only have the employee's name and records for related fields on the report. The table (contains emloyees' history data), form name, listBox (contains employees' names), and variable (contains the employee's name) are listed below.

Table_Employee_Detail_History
Form_Employee's Reports
Report_Attendance_Report
stremployee (variable

View 14 Replies View Related

Modules & VBA :: Passing Parameter To A Query - Data Sent To A Table

Jun 5, 2013

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.

Code:
DoCmd.TransferSpreadsheet acExport, , "qryUpdateWebmaster", _
"C:SubmarinersUpdates_Sent" & fname & ".xlsx", True, "Webmaster_Update"

View 1 Replies View Related

Modules & VBA :: Passing Data From Query To Textbox On A Form

Jan 7, 2014

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,

End Sub

View 7 Replies View Related

Passing Values Between Forms Using Vba

Aug 7, 2005

I have one dialog form which can receive values from multiple forms.
For each form i can build a popup dialog version but that's to much time in administration later on.

The best thing is if i Can declare a variable from the source form and pass it to the target control box in the dialog form.
I tried many ways but currently it's not working.

Maybe you've got example code for me.
Thanks

View 13 Replies View Related

Passing Variable Between Forms

Aug 8, 2006

Hi Everyone,

I'm trying to pass a variable called MyFilter between forms but am having problems. I have created a Module and declared MyFilter as a public string.

The original code in my first form is:

Private Sub Command65_Click()
Dim MyFilter As String
If Me.Filter = "" Then
MsgBox "Please apply a filter to the form first."
ElseIf Me.Dirty Then
' Make sure the record is saved
RunCommand acCmdSaveRecord
Else
MyFilter = Me.Filter
DoCmd.OpenReport "Temp", acViewPreview, , MyFilter

End If
End Sub

How to I change this so that it now stores the value in the Public variable instead of the Private one which it is doing above?

Thanks,

View 5 Replies View Related

Passing Values Between Forms

Nov 25, 2006

Ok this is probably easy for you guys but my knowledge of access is limited.

I have two forms - Find Job and Notes
On the Find Job form I have a text box called 'Job No' and a combo box called 'Status' that I have coded to open Notes if certain conditions are met. The code is

Private Sub Status_AfterUpdate()
If Status.Value = "WIP - Snagged" Or Status.Value = "WIP - Suspended" Then
DoCmd.OpenForm "Notes", , , acFormAdd
End If

What I need is to be able to pass the value of the 'Job no' text box on the Find Job form to the 'Job No' text box on the Notes form.

Many thanks in advance

Michael

View 1 Replies View Related

Forms :: Passing A Value To Pop Up Form

Jul 22, 2015

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:

DoCmd.OpenForm "addPartNumberMod", acNormal, , "ACB = " & Me.[ACB ID], WindowMode:=acDialog

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.

View 4 Replies View Related

Forms :: Passing Datasheet Value To Another Form

Mar 31, 2015

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.

View 3 Replies View Related

Forms :: Passing A Value Back To A Form

Oct 19, 2013

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'

View 4 Replies View Related

Forms :: Path Not Found - When Passing Arg Value

Aug 22, 2014

The code is a mix of someone else's and mine. Essentially the form is like a document library, based on the parameters in the form, it takes the original document that is selected by the user, then copies the file over to a central repository. When I don't pass a value over from another form using the following:

Me!AssociatedFeedback = Me.OpenArgs

Then everything works fine. Doesn't matter where I put this line of code (form open, after update, etc.) I get an MS Access error that says "Path Not Found" when you execute the "cmdSave" button.

Code:
Option Compare Database
Option Explicit
Dim strFilePathFrom As String
Dim strFileFrom As String
Dim strFilePathTo As String
Dim strFileTo As String
Dim strFileDeskTop As String

[code]....

View 11 Replies View Related

Passing Variables Between Forms In Shared Mode

Sep 28, 2006

Before I go any further w/this current application, I want to make sure this will work.

I have an access database w/a few forms that will sit on a shared drive on a network. Each user will also have their own username and password because each user will have a certain level of access to what they are allowed to see. The problem I am facing is that if I put the users ID into the global variables module, and two users log on at the same time, then access seems to somehow use both of the IDs when running queries. This makes sense that all uses can see it, since it's Global... but I need a way for simultaneous users to have a persistant unique id so I can query data that's only meant for them. I found this example of code that might remedy the situation by passing variables between the forms.

Call the code below in frmOne to pass the variable.

DoCmd.OpenForm "frmTwo", acNormal, , , , acWindowNormal, "Count=2"


Call the code below in frmTwo to get the variable.

Dim i as Integer
i = CInt(GetTagFromArg(Me.OpenArgs, "Count" ))



Will I end up w/the same result? Will all users be able to see this variable as well?

View 6 Replies View Related

Forms :: Passing Two Combobox Value To Two Textbox In Form?

May 2, 2015

Private Sub CardName_AfterUpdate()
Me.Purchasing = Me.CardName.Column(2)
Me.Selling = Me.CardName.Column(3)
End Sub

I get value of Column(2) in Purchasing textbox but in Selling textbox not why?

View 14 Replies View Related

Forms :: Passing All Field Values From One Form To Another

May 28, 2015

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.

LossForm Close Event: "DoCmd.OpenForm "Journal", , , , acFormAdd, , Me.LossID & ";" & Me.LossDate

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.

View 2 Replies View Related

Forms :: Passing Check Box Value To A Query As Criteria

Jan 30, 2014

I need to pass values of my two check boxes on my Form

Check box US and Check Box Canada
if both checked the criteria would be "UD", "ud',"b","B","us","US","CD","cd"
if Canada check box checked criteria would be "cd","CD"
if US only checked criteria would be UD", "ud',"b","B","us","US"

how to write the criteria statement on the query?this probably would be a complicated iff statement?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved