Forms :: Subforms Randomly Appear And Disappear For No Apparent Reason
Aug 2, 2013I've created a database with multiple subforms within the form; however some of the subforms randomly appear and disappear for no apparent reason.
View RepliesI've created a database with multiple subforms within the form; however some of the subforms randomly appear and disappear for no apparent reason.
View RepliesI'm having a weird problem in VBA on a button click. For no apparent reason the database closes itself. No error, no crash - it just closes. I've compacted and repaired it, recompiled it, but still exactly the same. The strange thing is, if I insert a blank message box at the point in the code where it quits, everything then works perfectly!
Also, if you leave Text4 empty so that it displays the message box telling you to enter a code to start, when you then enter something the next time it also works perfectly. Somehow the process of displaying the message box seems to fix whatever the problem is. I've tried pausing the code at that point, I've tried changing the focus to a different control or another form.
Here's the code:
Private Sub cmdReqLookup_Click()
Dim strTaleoReq As String
Dim strTaleoID As String
Dim intIDMatches As Integer
Dim strContractID As String
[Code] .....
'This is where the database quits. If I add a message box here, it then runs perfectly!
'Disable button
Me.cmdReqLookup.Caption = "Please wait..."
Me.cmdReqLookup.ForeColor = vbRed
Me.cmdReqLookup.Enabled = False
Me.Refresh
ScriptHold (1)
[Code] ....
My subforms are randomly adding blank records and one subform I would like to stay blank repopulates with data, though not necessarily the most recently added record. Both of these seem to happen when I navigate to other main records in the database and then return to this page.Using Access 2013, I have a large form with 10 pages. On one of the pages, I have two subforms. This is set up to gather many-to-one data. The top subform is my data entry form with three fields (two combo and a text) and a command button. The bottom subform is a datasheet displaying the three fields.
The two combo boxes are cascading, and they work great. The text box is there to collect additional info for each selection.
The command button works to
1) save the record,
2) requery both subforms in order to display the new data on the datasheet,
3) clear the combo and text boxes, and 4) set focus back to the initial combo box. It all works!
But then when I leave that main record, the horror begins: blank records (from the "many" table) show up on the datasheet and the data entry fields do not stay blank. I suspect my problem is in the command button. I added this code to the OnClick for the command button:
Code:
Private Sub addMinistryItems_Click()
'save record
If Me.Dirty Then Me.Dirty = False
'requery both subforms
Forms![BCD MAIN 2013]!Child572.Form.Requery
Forms![BCD MAIN 2013]!Ministries1.Form.Requery
[code]....
In my database, my "switchboard" consists of two listboxes: "Available Forms" and "Available Reports". The Available Forms listbox lists all the forms that can be accessed, and Available Forms listbox lists all the reports that can be accessed. I did this so that I wouldn't have to create buttons for each new form or report. They all are automatically listed in the listbox for the user to double-click on to open.
Since all my form and report names are not user-friendly (ie: fmComplicatedAndUglyName, rpComplicatedAndUglyReport) I want a way for the db admin to easily assign captions for each form that the average database user would find intuitive and easy to understand (ie: "Car Maintenance" instead of fmCarMaintenance). To do this, I built a table called tbDBObjectsCaptions consisting of these fields:
dbObject_ID (PK - Long Integer)
Caption (Text)
Next, I have an unbound form (fmDBObjectsCaptions) consisting of two subforms:
1) sbfDBObjectsCaptions_Forms, which lists all Forms with captions
2) sbfDBObjectsCaptions_Reports, which lists all Reports with captions.
Each subform's record source is tbDBObjectsCaptions with an Inner Join between the table and the MSysObjects table so that I can show only forms (Type field in MSysObjects = -32768) or only reports (Type field in MSysObjects = -32764). So, the record source looks like:
Code:
SELECT tbDBObjectsCaptions.dbObject_ID, tbDBObjectsCaptions.Caption
FROM tbDBObjectsCaptions INNER JOIN MSysObjects ON tbDBObjectsCaptions.dbObject_ID = MSysObjects.Id
WHERE (((MSysObjects.Type)=-32768));
(Except the Report's subform record source Where statement would have "-32764" instead of "-32768".)Each subform also consists of a "Caption" textbox and a combobox that lists all the forms or reports in MSysObjects. The Row Source for those comboboxes are:
Code:
SELECT MSysObjects.Id, MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "*sbf*") AND ((MSysObjects.Type)=-32768));
(Except the Report's combobox row source Where statement would have "-32764" instead of "-32768".)My first day playing with fmDBObjectsCaptions went fine. Both subforms' comboboxes list either Reports or Forms and would easily let me choose a form or report. The subforms would record the same "Id" from the MSysObjects table into the tbDBObjectsCaptions table and each Caption I typed in was recorded into the tbDBObjectsCaptions table for each "Id" I chose. It worked just fine.
However, the next day, I noticed that the captions I assigned for forms/reports were now assigned to different forms and reports! In fact, the fmDBObjectsCaptions no longer shows any captioned reports as their Types have somehow changed from -32764 to -32768 and are therefore now displayed in the Forms subform.
Either the dbObject_ID is somehow mysteriously changing for each record in the tbDBObjectsCaptions table or the Id is somehow mysteriously changing for each record in the MSysObjects table. I don't know how or why but that's what's happening. So now, in the fmDBObjectsCaptions form, my Forms subform is displaying the wrong captions for the forms, and is also displaying records that were originally Reports (items that have captions but blank comboboxes were originally entered in the Reports subform).
I attached a copy of the database. Any different solution that allows for easy Admin'ing of displayed form/report names?
I have disabled the Ribbon using XML code in the USysRibbon table. Everything has worked fine, except that now when I click on two different tabs that exist on my form, the Form Tools Ribbon pops up with options to go to Layout, Design View, etc., and other options, too.
I have two subforms on this tab, but neither one has a Ribbon Name set (I didn't even know how to do that when I made them) where to look to see why this is happening. The Ribbon does not show at all on the other tabs like it is supposed to. It only shows when I click on my 3rd and 4th tabs, and then it disappears again when I click on other tabs.
I have a textbox & button that when entered & pushed - run a query for the top values randomly depending on the value entered into the textbox.
My code is...
strSQL = "SELECT TOP " & Me.Text140.Value & " [CAN - NAME].Name, [CAN - CPT/VOUCHER].Voucher_Number, " & _
"[CAN - CPT/VOUCHER].Procedure_Code, [CAN - CPT/VOUCHER].Service_Date_From, [CAN - CPT/VOUCHER].Patient_ID, [CAN - CPT/VOUCHER].service_id, Rnd([service_id]) AS RandomNum " & _
"FROM [CAN - CPT/VOUCHER], [CAN - NAME] WHERE [CAN - CPT/VOUCHER].Service_Date_From Between " & Me.StartDate.Value & " And " & Me.EndDate.Value & " ORDER BY Rnd([service_id]) DESC "
It runs like it should but doesn't populate any records...that is until I go into the design view, deselect one of the fields and then reselect the same one - only then does it populate.
Do I need to open the query first and then update/append instead?
I seem to be having an issue with a split form I've been working on. I created this split form on Monday and it was working just fine but today, I have added a couple minor text boxes. Since then, I can view the form contents in Design View but when I switch to "Form View" or "Layout View", it's all gone minus the logo in the top left corner and the title for the split form.
View 12 Replies View RelatedSo I am creating a Complaint Tracking Database with Access 2013. In my 'complaint entry form' I have added to ability to "Open" and "Close" the complaint. While the complaint is open the user is able to enter/edit data in the complaint (new or old). When the complaint is "Closed" (done so with a button on the form that prompts the user to enter a date of their choice) the user should not be able to enter/edit data in the given complaint. In my original thinking, I placed checks on various events (on load, after update, on click) that checked to see if the current complaint had a date in the "Close date" field.
If the close date field was null then that meant that the complaint was open and the the controls would NOT be locked. If the close date field was NOT null (i.e. a date was present) then the complaint was closed and the main form fields were locked but the data was still viewable and unless they "re-opened" the complaint they could not change the data.
Now, in the complaint entry form, I have a subform that acts as a action tracker that is used by the user to keep track of the actions taken on the complaint (i.e. they requested documentation from such and such on this date..etc). My problem through all of this is upon closing the complaint and locking the main form controls, my subforms data just vanishes! At first I figured the problem might be with the linking of master and child fields, so I made sure that I left the ID in the main form unlocked when I loop through my controls during the locking process. This did not solve my problem. Code below:
Private Sub Form_Load()
Dim ctl As Control
If Not IsNull(Me.close_date) Then
Me.FormHeader.Visible = True
Me.btnClosed.Enabled = False
Me.btnOpen.Enabled = True
For Each ctl In Me.Controls
[Code] .....
Hi Guys
I want to ask you that what are the main reason that Microsoft Access is not using in large companies. I want to ask you that "Is that true that M-access can,t bear the too much records in one database and it slows down.My friend ask me that if we use backend of sql server and front end of Microsoft Access then what will happen? Is there any chance to increase the performance of Access based software by this method
Anxiously Waiting : Sohaib
Hi, i have a query which looks at a table named "attendance" the query includes the fields: "employee number", "absent code" (a 3 letter code), "absent reason" (list of different reasons) "shiftdate" (weekly shift dates in format: DD/MM/YYYY). If possible i would like to be able to promt the user to enter a employee number, then a absent reason (ideally from a list box) and show all occurences (with all the shiftdates) only of that particular absent reason within the last 12 months, and ideally calculates in another field the number of times that employee has been absent for that particular reason for the last 12 months.
Does this make sence?, i know how to promt the user to enter a employee number but not sure how to go about the rest, any help with what seems to be quite a challenging task to me would be excellent.
In Access 2010 I have a Data Entry Form on which I have an unbound textbox in the header that the user can put a default date in. In the body of the form is a bound textbox that records the date and the default value is set as =defaultdatestat (obviously the name of the box in the header).
Problem: The default date shows up perfectly until a value is put in any of the other text boxes.
For further info : If you put values in text boxes default value disappears; if you then push escape the default value reappears when the values in the text boxes disappear.
guys, here is my problem.
I created a tool to manage changes. As part of the process a support can edit a change to change the status and the requester can validate that the change is done properly. Both processes work in the same way, the diference is that the can modify different fields in the form. But here is the procedure.
Edit a task (support role): From a task management menu press the button to open a form with a list of changes to be done. Double clicking in a specific change number a new form with the change detail is opened. When the support finishs press the save button and insert the changes in a history table (to track the changes) and update the change table to update the record. Until this point everything is great.
Validate a task: (requester role): from the task management menu press a button to open a form with a list of changes to be validated. Double clicking in a specific change number a new form with the change detail is opened. When the requester finishs press the save button and save the changes in a history table (to track the changes) and the change table to update the record.
The problem is that the validate task form doesnt update the change table and doesnt insert all the fields in the history table, only some of them.
Here is the error msg:
" ILI index tool can't update all the records in the update query.
ILI index tool did not update 0 fields due to a type conversion failure, 0 records due to the key violations,1 records due to the lock violations, and 0 records due to the violation rule violations.
Do you want to continue running this type of action query anyway?
to ignore the errors and run the query, click yes.
for an explanation of the causes of the violations, click help"
Here are the sql to update and insert once the save button is pressed:
Public Sub grabarstatus()
'DoCmd.SetWarnings False
MsgBox "entered"
DoCmd.RunSQL "insert into [history] (change_id,before,after,user,modify,action) values (" & Me.Task_Num.Value & ",'" & vstatus & "','" & Me.status.Value & "','" & Forms!Login!username1 & "','" & Now() & "','Validate status');"
DoCmd.RunSQL "update [newchange] set status='" & Me.status.Value & "' where change_id=" & Me.Task_Num.Value & ";"
DoCmd.SetWarnings True
End Sub
thx very much
Is there any known issues and even better fixes for records where they partially vanish into thin air, well the meaningful contents disappear and I'm left with nulls. Been an ongoing issue for quite some time, rebuilds haven't fixed the problem, although the same table, different records every time too. There are in excess of 50,000 records in this table and it's just the one here and there, on a frequency basis, say every month or so. :confused:
View 2 Replies View RelatedI have a database that I previously ran successfully on a Windows XP system. I recently received a new PC with Windows 7 Enterprise (32 bit) that is having issues with running queries from the same database. I am still running the same version of Access (2003) on the new laptop but the queries seem to stall out and Access becomes non-responsive. Can switching from one operating system to another cause this issue? I am really just starting to use Access, so I am a novice at troubleshooting and thought that I would ask this question before digging deeper.
View 6 Replies View RelatedIf I put a calculated control on my form, I don't seem to have any way of pushing its changes to a field when those changes happen. Access can be downright infuriating at times. I've spent days just putting together a simple invoicing application.
My form is not based on a query like the northwind database, because that created such ridiculous and useless behavior with subforms that I couldn't. So now that it is based on a good old fashioned table, when I change a qty or price, the calculated "extended price" (=[qty]*[price]) field visibly changes just fine, but it never has an "after update" or "after change" event. Why would this be? How am I to save these bloody changes to an actual field in a table without using some grossly inelegant code?
I have several Suppliers, each of whom holds several SalesEvents. At each SalesEvent I might buy none, one or more Bundles. Each Bundle then contains one or more Items. These relationships are all reflected in my Access 2013 desktop db as one-many relationships with cascaded updates.
My form structure for data entry reflects the Relationships, in that I have a Supplier form with a SalesEvents subform. On that subform I can enter data about each of that Supplier's SalesEvents, and each SalesEvent row has a button to call up a SalesEvent form which has a Bundles subform. Then each row of that subform has a button which calls up a Bundle form containing an Items subform. That Bundle form identifies the Supplier, Sales Event and Bundle number, and within its Items subform I can then enter the data for each Item.
Problem : All used to work fine, but I've clearly changed something because now when I select the Items button on the Items subform in the Bundle form, the system gives me the data for the first record in the SalesEvents table, rather than the one selected. I have checked the raw data and that's as it should be. I have tried to undo all the steps I took since it last worked properly, but to no avail. Restoring the last backup (taken when I'm sure it worked properly) still has the problem.how do I find what data is actually being passed between forms and subforms ?
I have a query with a list of Customer SSNs and Claim Rep, I want to randomly pick 5 Customer SSNs for each of the Claim Rep.
I can't figure out on how to do that, I was able to create an SQL code to just randomly pick the customer SSN.
I don't know anything about Visual Basic codes, but if that is the only solution, please go ahead post it.
Thank you very much in advanced.
I have a table that consist of equipments. In it is a equipment number field. I need a way to randomly pull up these equipment numbers-kind of like a lottery. Please help.
View 2 Replies View Relatedwhen 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..
I have a scenario that I tried on an Excel forum but didn't have much luck. Conditions for my assignment:
1) Long description short, I have to randomly select 2 records for each client each month.
2) The catch is that these records have to be different states until the process is done for all 50 states, so the process isn't done for 4 years and 2 months (50 months).
I attached a sample database.
We will have around 100 people attending a program that will be broken into 7 (A-G) evenly. I would like to be able to have my database do this but I am unsure of where to start on this.
View 5 Replies View RelatedHi all
I am trying to give a new user access to the front end of a DB.
When I copy the FE from the server to the local C drive ( Windows XP)
the FE loses all its relationships and the user is not able to query anything.
I go back to the server and find that the FE is just fine on the file server.
I also tried running the FE from my PC ( Windows 2000 SP4) and it works fine.
Do any of you know what the issue could be.
I also checked to see that the new user has permissions on the folder on which the file is located on the server and she does...
Any thoughts on what the problem could be would be highly appreciated.
Thanks.
Recently
I have noticed that the "warnings" in my access 200o database no longer pop up. As example, if I went to delete a table or record, I used to get a pop up warning from MS Access asking for confirmation. Now the record just deletes without a warning. This seems to be happening with other things too.
Any thoughts ???
Thanks
Jackson:eek:
Hi, I am new to access and I have found important tricks in this forum. Thanks to everybody
Now, I am trying to use a query with multiple criteria. In particular it has to query a table that contains info about candidates tblCands using text boxes, check boxes etc etc present in a form.
First, it works correctly but if I close the form and re-run it, statements in query disappear.
Could someone indicate me what would be the problem?
Thanks in advance
I forum could someone tell me:
I have an unbound form on that form I want to put three sub forms one on a products table the other on a course start dates table and the link table that joins the other two together. all three are related to each other with Pk/FK links.
When I try to link them it says you cannot link items on an unbound form.
regards in advance
Peter:eek:
I have a main form with multiple subforms in tab view, right now the forms only open in edit mode, I would like all forms to open to new record mode. I know I can set the main form with the switchboard manager but what about the subforms?
View 2 Replies View Related