Forms :: Toggling Visibility Of Picture For Each Row In Form Detail Section
May 31, 2013
" Is it possible to toggle the visibility of a picture on a form's detail section for each row based on a query whether a certain condition is met? "
I have a form, which fetches data from a database and populates the content as a number of rows in the detail section.
For each row I want to test if a certain 'yes/no' condition is met on each query and the toggle the visibility on a picture that I have placed in the detail section.
I've tried seveal possible solutions now, like macros and VBA but haven't got it working.
i removed the DIsTINCT in my query to move some field to be updateable on the form. Once I did that my detail section of my form was empty ..why and how do I fix this problem.
I created a search form. It has 6 unbound text boxes and 2 combo boxes in the header. Users can select values from the combo boxes and/or enter names in the other text boxes. These values all go into a filter on my Main table and the filtered results show up in the detail section. That used to work fine.
Now, I've been trying to convert the filter into a query and show the query results in the detail section instead. (Why? Because of the ever-changing business requirements, of course!)
For some reason, the detail section went blank. All white. When I change the Data Entry property to No, it fixes that.
However, the text boxes for entering the search criteria will not accept any values anymore. It's like they are disabled.
When I change Data Entry property to Yes, I can enter text into the text boxes again. But the detail section blanks out again.
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)
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.
I made a form with a subform - in the form header it just has the title, in the details it has details about level 1, then in the footer it has level 2 with all records assigned to level 1's ID. My problem is in form view the detail section takes up half the page, I only need it to take up an inch or so. I tried dragging it in design view and it seems to work in design view but once i switch to form view it still takes up half the page. I also tried changing the numerical height for the detail section in properties but it wont change.
I'm trying to create a report where I can use a section header as a hyperlink to show/hide detail, but only for that section. For example, my customer names are:
Code: ABC Co. ZYX Co. 123 Co.
If I click on ZYX Co., I want it to show the contracts for ONLY that customer:
to hide a subform on my form that is in the detail section of my form.
Is there a way to collapse or Hide the Detail section of the main Form??
I notice that their is a property under the Detail section called Visible with an option for Yes or No.. How would I manipulate that option through VBA? I am assuming that is the option that I am looking for
when i generate a report i intermittently get a page that has the detail section highlighted. The report generates an invoice for each customer selected, a new page for each invoice with a repeating header on each page. I have used the vba to some of the formatting on the page. Usually there are between 20-40 pages generated with each report, or there is an option to print just one invoice. I get the highlight on 1 page on some set of invoices, and other everything works fine.
I can not for the life of me figure out what variables are causing the detail section to be highlighted. Does not repeat on a specific customer, place in the report, or any specific that i can tell. What settings/variables/triggers/events would cause the detail section to become highlighted blue.
Right now i can generate the report, see a blue page(usually after its printed), and the regenerate it and its not there or on a different page. The invoices uploaded are for the same person generated right after each other..
Is there a way to only highlight the last row of the detail section in a report?
I tried the following code in the "Format" but could not get it to work in Access 2010.
If Me.ClaimStatuses = "Total Potential Recoverable" Then Me.Section(acDetail).BackColor = vbYellow Else Me.Section(acDetail).BackColor = vbWhite End If
Where "ClaimStatuses" is the control text box and "Total Potential Recoverable" is the value I want to equal so this row which is the last row will be yellow.
I want a user to click the report, and an input box appears asking for a product number. This product number is used in a recordset (VBA code in the report) to fill the text boxes in the Detail section.
Code:Private Sub Report_Open(Cancel As Integer)Dim rst As DAO.RecordsetDim db As DAO.DatabaseDim itemCode As StringSet db = CurrentDb()itemCode = InputBox("Enter the Item Number", "Complete Catlog Prices")Set rst = CurrentDb.OpenRecordset("SELECT * FROM [Catalog Prices Complete] WHERE Prefixprodno = '" & itemCode & "'", dbOpenDynaset)Do Until rst.EOF Me!txtCat = rst("Volume") 'error 02448 cannot assign to this 'Me!txtPrice = rst("Price") rst.MoveNextLooprst.CloseEnd Sub
I'm sure my text box is called txtCat though. Is it an array I should try to fill? If so, any suggestions :S
In the detail section of my report, I recently added a second row which has only 1 text field. When the value of the textbox in the 2nd row is null, I want the total row height equal to just the first row. When the value in the textbox in the 2nd row is not null, then the total row height is equal to row 1 and 2. I tried to make the textbox in the second row invisible when it had a null value thinking that when it was null, the report would shrink to the first row height, but that didn't seem to work.
We are creating a report and for some reason we can no longer extend the detail section of the report. It has stopped at 2 A4 pages length and won't let us extend it further. We have about 7 pages of the report, I didn't think this was too much?
I have a main report with 2 subreports. My main report has a header section, the 2 subreports are in the detail section of my main report. How can i prevent my report from splitting up my header and my subreports. (Header section of my main report is a company and the subreports are the detail of the company.. i don't want my compnay name on the bottom of a page and then the detail on the next page.. it does this sometimes. thanks!
I have a query with various entries, pertaining to various invoices. Each line of the query corresponds to a piece of work done, and there may be several lines in the query pertaining to one invoice. I've written the code to input data to a report.
If there are multiple lines in the query to be added to the one invoice, I don't know how to write code that will add those multiple lines in the detail section. Same type of data on each line, just basically pertains to several different lines of work.
I have a report that lists states and cities within the states. When a state name happens to be at the end of the page the individual cities appear on the next page with no State heading. I solved the second page problem by setting the "repeatSection = Yes" in the Section Header (though I haven't shown that in the example below).
But the previous page (which just shows the State Name and no cities looks dumb. Is there some sort of solution.?? (Actually I would also like any State that continues to a next page to not just have the state name but something like " Colorado (Continued)" Is there anything I can do in VB to make a page break if the section is going to print but therer isn't enough room for one detail line?
This is what I currently see
Alaska Ancorage Prudo Bay
California Whittier Anaheim
Colorado ------------------------Page Break --------------------------------- Denver Pueblo Colorado Springs
Now I have "tbl_organs" with three columns "organNameLatin" and "organNameArabic" as body organs names in latin and its arabic translation,and "bodySystem" which contains body sestems "digestive, respiratory..." in Latin only, and "frm_visit" as a form for recording visit data, I added unbound combo box "cbo_organ" with raw source "tbl_organs", I addedd two command buttons "cmd_En" and "cmd_Ar" to convert the combo box value from english to arabic, I mean cmd_En for showing combo box with two columns "organNameLatin" and "bodySystem",for cmd_Ar will show "bodySystem" and "organNameArabic" , the value of "cbo_organ" then used with another field for populating a txt box, i used this code for onClick event for "cmd_En" :
Me. cbo_Organ = "select distinct bodySystem, organLatinName" & _ "from tbl_organs " & _ " order by bodySystem;"
And for cmd_Ar :
Me. cbo_Organ = "select distinct bodySystem, organArabicName" & _ "from tbl_organs " & _ " order by bodySystem;"
By pressing cmd_En nothing changes and combo box still showing three columns, also the final result is populating bodySystem in final txt box instead of organ name, I dont know if properties of combo box "cbo_organs" like column count and row source have effect on this or not, and if I should determine row source of combo box from the beginning or not ? NB: bodySystem is in one language only which is Latin, the form is unbound, combo and final txt box are unbound.
I am a novice ACCESS user, so my questions may be elementary. In Access 2007, I have a query that presents the user with a list of the contacts he/she is approved to access. I want the user to be able to "drill down" to the detail form for a specific contact by double clicking on his last name, but I have not been able to find a property sheet for the last name field in the query to which I can apply the code.
I have a main form that I want users to populate before I reveal a sub-form. I've changed the 'visible' property to 'no' on the subform so it doesn't show by default but can't make it re-appear when I want it to.
I've tried the forms!whereform.visible=true code and it tells me it can't find the form 'whereform'.
Ok, this is what I have, I have a database that has 3 tables, a year table, that all my forms get inputted into, a table that has manufacturer addresses on it and a table that has sampling locations.
On my form, I have it where there is a drop down box, so you can just select the name of the manufacturer and select the name of the sampling location. But what I want it to do is, that you select the name from the drop down box and then in another box or two it auto populates the corresponding street address, and city for both the manufacturer and the sampling location.
I have a bound form which shows list of items in the stock. When i click on a button it should open another form which shows the details of item which we choose from the first form.the code which i have in click event of the form is :
Code: Dim strCrit As String strCrit = "PkID=" & Me.RadStocks DoCmd.OpenForm "frmIssueRadItems", , , strCrit
It works sometimes but most of the time it gives error saying " syntax error(missing operator) in query expression 'PkID=Airmux 200E DC".
The form is specifically made to be wider than the screen, so that there is a scroll bar at the bottom. I have an embedded picture for the background which is intended to be the size of the form, meaning that the picture is also wide.
In Design view, I can see that the background picture fits the form perfectly, which is what I want to see in Form View.
In Form view, though, the picture is squished to fit the screen. The only time it doesn't do that is if I set the Picture Size Mode to Clip, but then it only shows a portion of it, and when I scroll horizontally, the background picture doesn't scroll with it.
I am trying to get a subform to be hidden when the value of a textbox (txtAllocationID) is empty but when a ID number appears I would like it to become visible again.This is what I have tried so far but doesn't seem to work:
Code: Private Sub txtAllocationID_AfterUpdate() If Me.txtAllocationID.Value >= 0 Then Me.frmStockAllocated.Visible = True Else Me.frmStockAllocated.Visible = False End If
End Sub
My allocation ID is a primary key so all auto number generated and only an integer.
Scenario: When I enter a stock ID of 121 and search I want the subform to remain hidden as there is no Allocation ID related to that Stock ID (see attachment tblAllocated). If I was to enter a stock ID of 122 I want the subform to become visible as the stock ID has a relation with the Allocation ID 6 and therefore the textbox txtAllocation ID would display '6' in it.
When I have a simple table, users pictures inside maps (jpeg,png...) defined as OLE object, when creating the form from that tables, don't have picture shown, only name of the picture? I tried all the options, package, copy, paste... nothing...always the same... just picture name but no picture.