Forms :: Grid-rows Not Displaying Selected-state Correctly After Many VBA Requeries
Mar 2, 2014
when i select rows in a ListBox control on a form, using access VBA, some rows behave exactly the opposite of how they're supposed to behave-- they APPEAR unselected when i select them, and selected when i unselect them.
Code:
oListBox.Selected(lngRow) = True
However, when i check their Selected property with VBA they return the expected value (meaning the row Selected value is TRUE if i set it to TRUE, if tho it LOOKS UNselected).
Code:
Print oListBox.Selected(lngRow)
->True
Access ListBox Control Under VBA Control Behaving Wacko - YouTube.It seems that the more times i requery the listbox, the worse the problem gets.
Code:
oListBox.Requery
This problem seems unrelated to the number of times i select rows. Only seems related to multiple requeries. At first, it does not happen. Then with repeated requeries, the problem gets progressively worse. Note, 'Row Source Type' is set to 'Table/Query'. 'Multiselect' is set to 'Simple'.
i'm not using the "Form_" syntax anyplace (which can created unintended instances of forms). this listbox source-query contains a VBA function in a module, which in turn calls the code-behind of another form.
I have a Combo Box bound which gets its values from a table (T_Users).
The Combo Box displays the Users 'Initials' [Column 1], but the Bound Column [Column 2] is that of the Users 'ID' (which is used when a record is edited or a new record added).
What I want to be able to do is when the user clicks the Combo Box, and the drop down list 'drops down' the options, I want them to not only see the 'Initials' but also selected other columns - BUT - when the option is selected I just want the 'Initials' to be displayed in the Combo Box.
Code: So, Normal > | ABC |
Dropped Down > | ABC | -------------------------------------------- | ABC (Annabel Carcus, Big Company Ltd.) | | JB (Joe Bloggs, Medium Company Ltd.) | | FS (Fred Smith, Little Company Ltd.) |
I have been trying to figure out why my subreport is only showing sales price for only one of the records on my subform. Everything else works as it should, but it only displays the sales price for the record which is active on the subform.Attached is the database with the subreport called rptProposalItems with the field 'Sales Price' which is experiencing the issue.
I am trying to create a table of help messages and display them help in a form. Using MSAccess.
Each Form used will have a help button, that runs a macro "mcrHelp.xxxxx". This macro should select the relevant record from the table to display in the "Help Form".
I have extraction report from calculation program and dont have access to tables. When I import it to MS Access it looks like attached Sheet1. Is there a simple SQL query or VBA code which will allow me to import the data to new Sheet2 table? Fields 1,7&13 will always be the same and I want them to be column names, Fields 4, 10 &14 contains data which will be different each time I delete the old calculation from Sheet1 and import a new one. I would like to be done in Access as I have to import few hundred calculations and store it in Sheet2 table.
I have a table (tbl_entry) of performers and the different sections they are performing in. I can pull the performers for each individual section but is it possible to then give the performers a random number that will indicate the order in which each will perform. Eg: 5 performers in section 21a
Molly Mary Mike Merv Mandy
So can I get access to randomly assign numbers 1-5
I have a form (Student Details) that has an unbound lookup box using a query to select a student. The lookup has the hidden Student ID autonumber key field plus Class Number, Last Name, First Name, Status, sorted by Class Number (descending), Last Name, First Name.
The form record source is a similar but unsorted query.
There are nearly 1000 student records. The form has pages (tabs). The lookup box is in the form header. There are dozens of fields in the 1st Page (General) including an picture (attachment, not hyperlink) field holding a photo of the student, the other 6 pages have less.
When you select a student via the look up, at least one sometimes more students "flash" before it displays the one you want, which seems to display twice before it stops.
I deleted the picture field to see what difference that made, because it seemed to do the most flashing, and indeed, without that field you go right to the record. I looked at the Student table indexes and it seems that field type is not index-able, which is understandable.
Is there any way to improve this with still leaving the photos as attachments? Some thoughts:
It improves if it is displayed first as an Icon or Paper Clip, and probably would if a hyperlink field, but we like to have the picture displayed and not have to open the link to see it nor worry about the location changing invalidating a link. It seems that if the record was displayed with the picture field only filled after all the other fields were filled it would make for a better impression.
Can an On Load form event VBA or Macro be written that either hold the picture back until the rest of the fields are displayed or if an icon or changed to a hyperlink to open. Would it work if the pictures were attached to a separate joined table?
In ACC2010: A subform has a control for date of birth with an AfterUpdate Event. When the date picker is used to populate the control the user must either click outside the control or press the tab key to trigger the control's AfterUpdate event. This event runs some calculations, the results of which are stored in a separate table. When the calculations are finished and focus returns to the form, the form's state depends on whether a keypress or a mouse click was used to trigger the event.
The form's state is indicated by whether calculated controls on the form are empty - mouse clicks leave contents as before the event, tab causes the contents to disappear. In addition, if a keypress is used the user must click twice to trigger the form's BeforeUpdate event. A single click is required to trigger that event if a mouse click occurred after using the date picker.
How to get thekeypress to behave the same as a mouse click?
I'm trying to create a simlpe database that is use to store time worked for clients (see attached).
If you run the form frmClientEntry i have two issues.
1 - you will see that the title is automatically selected from the combo box. However is i try and enter the form I'm told 'You cannot add or change a record because a related record is required in table 'tblTitle'. If I select one of the entries I get rid of this. I would like the default to be selected...
2 - There is no entry in the hourly rate column field even though there is an entry in the table. How do I get my hourly rate to show? Ideally this will only be a single text box and not a comboBox as the hourly rate will be the same for every client.
If this is a table design issue please let me know and I'll post there.
Hello all. Hope I describe my problem correctly. :D
I have a near complete database with forms linking to tables. Tables have relationships with keys set to ref. integrity/cascade records.
Here is the problem -
My forms are meant for people to input data into these tables. However, I do not want them to change those keys.
Problem 1) If I set primary/foreign keys to "autonumber" I cannot get the relationships to recognize ref. integrity and the records will not cascade, and will not update.
Problem 2) If I set primary/foreign keys to "double integer" then if someone enters a new record into the forms, it is recorded as "zero" when it should be updating in numerical order (I have 479 records in the database, so the next new record should be 480).
Problem 3) If I change it any other way - from double integer or auto number, the tables do not update at all, or do not update correctly.
What is going on here? I thought creating forms was a fairly simple task - create the form, it is related to the table, update the form, it updates the table. I mean, duh. :confused:
Thanks anyone for your help, because Microsoft's site sux.
Made some tables with data, then wanted to filter it by form with comboboxes approx 10 of them, so started to write a simple query but it doesn't really work. Then I found this forum and when started to review some threads, noticed that some (most) of you write a query in vba under a button with on_click function.
The question is, what is the correct way of writing a query? Is is a vba code under a button, or is it a code in the actual query?
I have a continuous form that is using a select query to populate all of the bound controls. The drop downs and text boxes are displaying the values from the correct places. But, the form is not updating in the places I expected.
The select query that is being used to populate, combines information from 3 tables.'TimeEntries' table (the one that I want records to be updated in). This holds employee ID, and numeric values for Project Name and Project Task.
'ProjectInfo' table (nothing should be updated here). This table holds other details about the project (ex. Project Name) that is used to populate a combo box. 'ProjectTasks' table (nothing should be updated here either). This table holds details about project task (ex. Task Description) that is used to populate a combo box.
The issue I am having is that when records are updated on the form, they are adding records to all 3 tables that are a part of the query, instead of just updating the time entries table.
Record Source (form) = Select Query "EmployeeTimeEntry"
I have been having issues with a subform on the attached database - for some reason it is not always updating to show corresponding records.
What I am planning, this is effectively going to be an interactive learning portal which can test users as well. There will be learning material (not yet included) and a bank of questions with corresponding multiple-choice answers, only one of which is correct. Each time the main form is loaded (Cat1MainForm) it randomly selects and orders questions, then, via a sub-form, returns three potential answers. There will then be radio buttons with which the users can answer appropriately.
If you load up Cat1MainForm and scroll through various questions you will see that sometimes the answers appear, other times not. Sometimes on one record the answers are there, you navigate away and back, and they have disappeared, and vice-versa.
I am using Access 2007 with Windows XP. I have a scatter chart embedded in a form that is plotting data from a subform with a trendline that is extracted and used on the form for calculations. After having the table set up correctly and running fine, I closed the database and then reopened it to have the table plotting the data in a made up 1 to 1 relationship rather than what is in the datasheet. The only way I have been able to fix this error is to change the chart type to something else then back to a scatter plot and remake the trendline. Why this is happening and how to prevent it?
I have a form based on tblContact with a subform based on table tblCategories, and another subform based on tblCompany. I have a one-to-many relationship between tblCategories and tblCompany, with the pk in tblCategory linking with a fk in tblCompany. All of the fields in tblCategories/ sbfrm Categories are yes/no fields, not sure if that plays into my problem at all.
When a user checks one or more of the check boxes in the categories subform, closes the form and re-opens it, none of the check boxes are checked for that person. I know this has something to do with the relationships and how the categories are linked to the contact... but I can't get it straight in my mind as to how that should be set up.
I have a form "FrmMaintenance" based on the query "QryMaintenance" that is taken information from the table "TblMaintenance".
In the form, I have to pull the serial number of a machine from a drop down list which works perfectly fine in the form and it also updates other associated records.
When I go to the table, it puts associated number instead of the serial number that I've pulled.
Same thing happening for the pull down list "Engineer".
I've tried to look at the format of the "SerialNo" and changed to text, then to Combo Box but it didn't work, and the same for "Engineer"
I have created a piece of code that filters a sub form of diary records using criteria the user has selected or entered. It was working fine when I made it a month or so ago and now is seems to be returning incorrectly filtered records, for example, I enter 2 dates to return all diary entries between the 2 dates. Yet it misses some records out that should be within the date range, and it sometimes include records that are outside the date range. I am also getting an error when I try and filter the diary entries via the supplier, "data type mismatch", here's the code that, bearing in mind, was previously working fine.
Code: Public Function filter_diary() Dim dbs As Database 'Dim qdf As QueryDef Dim Sqlstr As String Dim sqlstrwhat As String
I would like to seek guidance again on my new project, I wanted to create a data entry form that the user can input records using my unbound label boxes, then upon hitting an add button it will go automatically on a subform below or a GRID so that the user can see all the records at a glance.
I have Grid X and Grid Y set at 24. Usually I see dots all over my forms.... which allows me to snap controls to the grid. Today I only see large boxes instead?
I am a beginner with aggregate functions. I have two tables, one describing parts, and one describing assemblies that use those parts:
tblParts show all the part descriptions, including fldPartNumber.
tlbWhereUsed shows zero or more fldAssemblyNumber records for each fldPartNumber.
I want a query that shows, for each record of tblParts, the number of assemblies that use that part. I specifically want to do this with an aggregate function:
Ok, I know you guys have heard about this problem quiet a few times, my search told me that. But my problem has a bit of a twist. The message appeared when I tried to open the database yesterday, so I went to the backups and tried to open them. All the backups for the past month give the same message. The problem is with the FE only, the BE is working fine. The backups are connected to the same workgroup as the FE and BE. Has anyone seen this before and know what might of happened?
I am trying to determine the state that a job is located in. If the ProjectID begins with a 2 then it is in California. If it does not then the job is located in Nevada.
Does any one know of a place online where you can get the tables (for free I hope) for a city state zip comboboxes, or at least the tables for all cities in the US.
If the check box is null (grey) - the default value, I do not want to include it is the sql statement. If I use the code below I get the error 94 Invalid use of null. How else can I exclude this ststement is the check box is grey.
thanks
If CheckStaged Then strWHERE = strWHERE & " AND s.Staged = " & CheckStaged End If
1) how can i have a record automaticly fill in the next date from the privous record? (Example if record 1 has date:10/14/05 i want record 2 to fill in in that same feild 10/15/05?
2) how can i have a reccord automaticly fill in the same number from the privios record? (Example if record 1 has Number :34 i want record 2 to fill in in that same feild 35?
I keep on changing these numbers, so its vitel that it repeats the privous record