How Do You Refer To Fields On A Sub Report

Sep 25, 2005

I have a main report which has a subreport. On the main report I have txt fields that I want to change their background colors based off values in fields on the sub report.

Thanks

Jon

View Replies


ADVERTISEMENT

Modules & VBA :: How To Refer To Controls In Selected Report

Jun 3, 2014

i have created a module under module section of my DB My Report Name : "PURCH VB Query"

the code is as follows : (what is want tell you later..)

Code:

Sub Erlick()
DoCmd.SelectObject acReport, "PURCH VB Query", True
'"PURCH VB Query", acViewPreview, "PURCH VB Query"
For i = 1 To 3
DoCmd.PrintOut acPrintAll, , , , i
Next i

'This is for creating Seperate Text Per Copy in RptHeader Preview End Sub

i've placed a TextBox in my report named Text25 to the value :
=+1
properties-->data-->running sum--> Set to OVer all

i've also set a textbox in my report named CpyWord to the value : =IIf([Text25]=1,"Original Buyer Copy", IIf([Text25]=2,"Duplicate File copy",))

Now what is want is Three Copies of Report with Two copies marked seperately as per above IIF statement

As i want Three Copies with each Rpt-header as Different Text

Possible solutions (ba donna no a script) How do i refer to Report's control after Docmd.SelectObj.... if any facility then i can do easily thru the dazzling for next loop How do i increase Report's control Text25's value, if three copies r there I know there are many events in Report

I've stucked over this point. My all App in db is ready

View 10 Replies View Related

General :: Refer Field In SubReport Which Is In Report Footer

Nov 21, 2013

I want to refer field "plyty_sa" which is in "RaportZleceniaRobocze" Report, in "RaportRobocze_Offset" SubReport. The problem is that, SubReport is in Report Footer. I tried many possibilities but I can't find solution.

View 1 Replies View Related

Does MS Access Report Support Hide/Show Fields At The Report View Time?

Aug 19, 2007

Does the MS Access Report support Hide/Show specific fields according to parameters or even by click?

View 3 Replies View Related

Reports :: Scrolling Down Report Changes Report Fields To Errors

Jun 26, 2013

I have an odd thing happening with my reports. There is a main report that gives class information (from query). There are two subreports (from queries also ) with scores (one for each type of test). There are some unbound controls on the main form that display a count of how many scores are recorded which are totals from the subreports. The controls all report the correct numbers however, when I scroll down to view each record, some of them change to #error, or #name, or similar for a moment. Sometimes they will stay in error form when I stop scrolling but change to correct if I scroll up just a bit. Is this because the controls won't calculate unless that report record has focus?

View 1 Replies View Related

Refer To Subform

Apr 29, 2005

I have a Main form with two subforms Sub1 and Sub2.

I want to set the RecordSource of Sub2 from the OnGotfocus event on Control1 on Sub1.

My code is:

Dim intCtrl as integer
Dim strSQL as string

intCtrl = Me.Control1
strSQL = "Select * from MyTable where Id = " & intCtrl
Forms!Main!Form!Sub2.RecordSource = strSQL
Forms!Main!Form!Sub2.RecordSource.ReQuery

When Control1 gets the focus I get an error Runtime error 2465 Access can't find the field 'Form' referred in your expression.

Have tried many permutations but no luck.

Grateful for help.

View 1 Replies View Related

How To Refer To A Text Box With The LIKE Operator?

Sep 17, 2007

Hi everyone!

I'm working on creating a small database for the company I work at and just can't figure out the syntax to make this work.

If I create a query that looks for clients Like '*Smith*' , it returns records where the client is John Smith, Smith and Company, Edward Smith & Jones, LLC and that part works great! I did this by typing: Like '*Smith*' in the criteria field for Client in the design view of the query. (Also seems to work whether I use single or double quotes - not sure about the implications of that).

Now, I want to replace the word Smith with whatever a user enters into a text box, I can't get the syntax right! In the design view of the query, I've tried things such as: Like '*forms![Search by Client]![Text0]*' with no luck. Any ideas? Maybe I'm missing some brackets or parenthesis?

View 3 Replies View Related

Refer To Controls Using Variables

Feb 10, 2005

I have a form with 25 related sets of text-box controls:

Product1, ProdDescr1, ProdQty1
Product2, ProdDescr2, ProdQty2
... Product25, ProdDescr25, ProdQty25

I need to loop through all 25 to check that the ProdQty for each is correct, and if any of them are incorrect, I'd like to set the BackColor to Red and the ForeColor to White for that particular set of controls. Rather than coding all 25 checks, I'd like to use variables to loop through the 25 sets

I understand how to create an incrementing Integer variable, but what is the correct syntax for combining that Integer variable with the String variables in order to perform the Back/Fore color commands?

View 2 Replies View Related

Form With If Refer To A Value In A Field

Feb 13, 2005

Hi All!

Well I got a problem and guessing this is possible to do like this but well after few hours and staying at the same point maybe some help can be greet

I have a database witch I have 2 important field and a command for this. A field called ID with a number and another called GenerationID who contain number between 1 to 12 depending of which generation is. I got this Generation ID from a subform. What I want is this:

Depending of the number in generationID field show a different button like ID3 with generationID = 3 or ID2 if generationID = 2 etc until 12 and then other command buttn is not visible.

I don t know how to put the code but the code probably look at this:

If generationID = 3 Then
ID1.Visible = False
ID2.Visible = False
ID3.Visible = True
Else If
generationID = 2 Then
ID1.Visible = False
ID2.Visible = True
Id3.Visible = False
End If
End If

or if you have a better way all is welcome.

View 4 Replies View Related

Refer To A Table Value Though Form

Mar 10, 2005

How can i refered to a table value through a form?

Thank you!

View 5 Replies View Related

How To Refer To A Subform Properly...

Oct 11, 2005

Hey everyone

This issue is holding me back now on 2 areas of my project :(

I need to know correctly how to reference a subform in a query.

Can someone please give me a working example for this:


main form: training courses
sub form control: course_dates subform control
sub form: course_dates subform
text box: course_date


I have tried:

[forms]![training courses]![course_dates subform control]![course_dates subform]![course date]

in the criteria box, but every time the query runs i get a parameter box "forms!training courses!course_dates subform control!course_dates subform!course date" asking for the info.

Seriously I am totally stuck on this and i think all i need is one perfect example... please help!!!

View 3 Replies View Related

Hwo To Refer To A Form Instance

Feb 17, 2005

I'm sure this is simple, but I can't find it anywhere...

How do I refer to an instance of a form using its key value?

For example, I have a collection 'colForms' and two forms in that collection with the keys 'Key1' and 'Key2'. How do I refer to the instance that has Key1 in code (for exampe, to close or requery the Key1 instance of the form from another form)?

Thanks in advance,
David
dminstance

View 1 Replies View Related

Tables :: Refer To Another Row In A Table

Mar 3, 2015

I have a table with 6 columns (Field1, Field2...) and a primary key called ID (1,2,3,....).In the first column (Field1) I want to retrieve the value from the 6th one (Field6) but from the above row. Something like this:

Field1 (ID2) = Field6 (ID1)
Field1 (ID3) = Field6 (ID2)

How can I translate this into a formula?

View 2 Replies View Related

Can I Use DateAdd To Refer To A Pre-entered Date?

Apr 20, 2008

Hi again

I've done some searching on this question and it seem everyone is pointing to the DateAdd function, so here is my current problem.

I have a date/time field called SponsorshipContractDate. When a contract is signed the date is entered. I need the system to calulate the renewal date for the contract which is alway 1 year ahead.

The DateAdd function works only if I hard code at date into it e.g.

DateAdd ("yyyy", 1, "01-Jan-08")

But as contracts are signed throughout the year this just doesn't work so I tried this:

DateAdd ("yyyy", 1, "SponsorshipContractDate") but the table won't save and this is abviously not right. In my head it makes sense but I don't understand how to get the formula to look at another field during it's calculations

Am I using the wrong function?

I will keep looking around.

Thanks heaps

View 4 Replies View Related

Refer To Previous Calculated Field

Jan 17, 2007

Access 2003.
I was just wondering if there was any way to refer to a calculated field in the same query.
For example if the first calculated field was - Total: ([Quantity])*([Price]), could you add another calculated field - Inc Tax: ([Total])*1.175.
At present I am having to type the whole formula in the calculated field again which seems to work for some queries, but not for others, no matter how I fiddle about with the syntax. The other way is to create another query and refer to my previous query. Both these methods seem extremely cumbersome and I was wondering if I have missed something with referring to a prior calculated field.
The query above is just an example, my query formulas are actually fairly long and for editing purposes it can be difficult to correct them.

View 4 Replies View Related

Query Needs To Refer To Date On Form

Jun 8, 2005

Hello - I have a form with a txtbox that shows a date. I need the querry to refer to that date as selection criteria. I have the following in the criteria of the query: =[forms]![frmUpdatePayments]![txtDate]. I know the problem is I need # at the beginning and at the end of the date, but how do I do that?

View 1 Replies View Related

How To Refer To A Single Detail Record, Not All

Feb 17, 2005

hello. can i refer to a single record in a detail section, and not all of them? for example if i use something like this (after update in field1):

if me.field1 = 0 then
me.field2.enabled = false

any single field1 equal to zero will disable ALL of the field2's. i would like this to work within each record independently.

View 2 Replies View Related

How Do I Refer To Subform In Conditional Macro

Nov 2, 2006

I have a form named frmtestpkg which has a subform named pkgsubform. The control the subform is in is called pkgsubform1. I have written a macro which works very nicely to hide or show the field [Days2process] if I attach it to "on current" on pkgsubform and open pkgsubform as a form. If I try to open pkgsubform as a subform I get a message stating "The object you referenced in the Visual Basic procedure as an ole object isn't an ole object."

How do I change my macro to refer to the form and controls as a subform?

my Macro looks like this:

condition: [Forms]![Pkgsubform].[CrPkgStatus]<>"Accepted"
Action: SetValue
Item: [Forms]![pkgsubform]![Days2Process].[visible]
Expression: No

condition: [Forms]![Pkgsubform].[CrPkgStatus]="Accepted"
Action: SetValue
Item: [Forms]![pkgsubform]![Days2Process].[visible]
Expression: Yes

View 2 Replies View Related

DESPERATE:cannot Refer To Subform Control

Nov 14, 2006

Still beating my head on the wall. I'm sure it is simple but I NEED guidance.

I've made a macro to show a date field when the "Yes" option button is selected and hide it when the "No" option button is selected. I first created it for the form to act on its own --> and it works. Now I want to use that form as a subform in the form [frmTestPkg]. I am having problems figuring out how to reference it properly as a subform.

Here's my macro that works when I attach it directly to my form:


Condition:[Forms]![frmsubcruiseplan]![CrPlRecvdNo].[OnGotFocus]
Action: SetValue
Item: [Forms]![frmsubcruiseplan]![CrPlSubmDate].[Visible]
Expression:No
Location: "On Got Focus" Event for the option button "No"

Condition:[Forms]![frmsubcruiseplan]![CrPlRecvdNo].[OnGotFocus]
Action: SetValue
Item: [Forms]![frmsubcruiseplan]![CrPlSubmDate].[Visible]
Expression:Yes
Location: "On Got Focus" Event for the option button "yes"

I have followed the pattern provided previously of

Forms![main form name]![subform control name].Form![control name]

but cannot get it to work -- obviously messing up somehow.

The reference I tried in the condition looks like this

[Forms]![frmTestPkg]![frmsubcruiseplan].[Form]![crplanrecvdNo].[OnGotFocus]

--> and with or without the setvalue information included I get a "The object you referred to as an OLE object isn't an OLE object" error.

Perhaps I am not identifying the subform control name properly? Or maybe I should be referring to the "Cruise Plan Recvd Option" instead of the individual control boxes (but it worked as a form)? Please spell it out for an idiot, what this is supposed to look like. Many thanks!

View 1 Replies View Related

Reports :: How To Refer To A Control On Subreport

Feb 12, 2014

I have a report with several subreports. I need to total the subreports onto the main report. How do I refer to the control on the subreport?I know that with a form / subform I would use: Me!Subform1.Form!Controlname.But simply replacing 'Form' with 'Report' doesn't seem to work.

View 1 Replies View Related

Modules & VBA :: How To Refer Object By Its Name When Name Is A Number

Sep 12, 2014

Actually in a powerpoint slide, I am having a set of 31 shapes having their names as numbers from 1 to 31.

How to refer by its name?

By hardcoding I refer it like this:

activepresentation.slides(1).shapes("1").someprope rty = somevalue

How to do it in a loop?

Code:

for i = 1 to 31
activepresentation.slides(1).shapes(i).someproperty = somevalue
next i

The above code will refer the shapes only by the index. But the shapes are not having index and name as same.

View 9 Replies View Related

Using A String Concatenation To Refer To A Control Name?

Feb 28, 2015

know if there is a way to use a string concatenation to refer to a control name. eg. Referring to Control1, Control2, Control3, Control4, etc using something like Me.["Control" & "1"], Me.["Control" & "2"], etc

View 6 Replies View Related

Reports :: Unbound Report - Print Preview OK But None Of Fields Print When Report Directly Send To Printer

May 25, 2013

I have an unbound form with an associated report. When the user hits the 'print' button on the form/screen, the report is launched in the background. In the On Load event of the report I populate the report fields from the forms field as so:

Code:
Me.txtAddrMainLine2 = "NAME " & UCase([Forms]![frm_OrderRx].[txtPatientName])

This works like a charm as long as I call the report in Print Preview mode (i.e. with acViewPreview). But if I send the report directly to the printer, none of the fields print.

I've read about using other report events to populate the fields (e.g., On Format and On Print) and also something about using TempVars to pass the data. But I haven't read anything that's clear and definitive about the full answer.

View 3 Replies View Related

How Rewrite Queryfilter To Refer To A Control In A Subform?

Aug 16, 2006

Hi!

I've developed a form to be standalone. It's based on a query with filter like this:

Like "*" & [Forms]![myForm]![Fltr1]

(The Fltr1 is a combox value.)

Now when i place the form "myForm" as a subform in another form (FormMain), the query does not give me any data.

How do i refer to the filter from the query??

Any help will be much appreciated!

thanks ;)

View 2 Replies View Related

How To Refer To Parent From Subform's Control Row Source

Oct 10, 2006

I have a main form with a subform. On a subform I created a combobox which I want to populate with ClassIDs that match the main forms Individual. I know the criteria in VBA for the above would look something like this:

"SELECT tblClassesAttended.ClassID FROM tblClassesAttended WHERE blClassesAttended.IndividualID=" & Me.Parent!IndividualID

but when I type such statement in the row source of the control it does not work. What is the correct way of refering to the parent form when typing the SQL in the row source?
BTW. I cannot use the main form's name

View 3 Replies View Related

Forms :: Refer To Detail Section Of A Subform From Another Pop-up

Jun 29, 2014

I have a 'master' navigation form called 'NPYWC'

On it, there is a subform called 'patient' - this has a number of subforms in the detail section (Linked on a one-to-one key).

When the patient form loads, I hide the detail section until a user either

A. Finds an existing client record or
B. Clicks the 'ADD NEW' button

The ADD NEW button opens a separate (pop up) form where the primary patient information is gathered. When the user clicks "Save" on the pop up, my VBA script ...

A. Creates all the one-to-one relationships that are required.
B. Updates the 'Find Patient' field to the newly created patient number
C. Finds the new record
D. Un-hides the detail section (This is what I cant get to work)

I have tried a number of things. The latest being

Forms![NPYWC]![NavigationSubform].Form![Section].[Detail].Visible = True

The rationale for hiding the detail section in the first place? The answer is twofold.

1. If the user simply creates an new patient, the three actions (A, B C above) don't always run/display the data properly. (Im not sure why? ) The pop up form seems to be a good working solution for me.
2. My users have a tendency to change data on the default patient. I have tried going to new record, but then they add new (often duplicate) patient records.

View 3 Replies View Related







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