On my Form I have a Label (Recnote) which gets changed by the VB code if criterior is true. My form does change this correctly however, once I quit (or close the Form) and come back, the changes dissappear.
But the strange thing is that every now and then it does save it.
Any ideas??? Any other command I should use?
The following works as it disables my Import button and changes the Label contents but does not save when exited
Private Sub CloseME_Click()
DoCmd.Requery
If [CountOfOracle Co] = 0 Then
MsgBox "Cannot Close ME Yet", vbOKOnly, "Circular Rec"
Else
Me.Recnote.BackColor = 65535
Me.Recnote.Caption = "Final Reconciliation"
Me.Recnote.ForeColor = 32768
Me.Import.Enabled = False
DoCmd.RepaintObject
DoCmd.Save
End If
I have a form and I do not want the mouse wheel to move through the records - it is a single form view and I do not want the use to use the wheel as it corrupts my calculations.
Is there any way to allow input of numbers input without the wheeldoing anything
I have a form (TransactionBody) & a subform (Detail) in the body I have an option group (Reg Office, Unaccepted and Returned) and want the returned button to be true "IF" a box Yes/No box called "Returned" is checked "yes" in the "Detail" form. I have done simular things in regular forms but not with a subform. I know I need to setup a afterupdate event in the Detail subform in the "returned" yes/no box and I know the basic if..then...else lingo I just don't know how to reference the transactionbody form in the formula from the detail form.
Alright. I've tried searching, but to be honest, I'm not even sure what to search for.
I want to create some VBA that onLoad of the opening form of the database, it will take info from a query that looks for data entered for a student. It will be looking to see if there is data in two date fields. If it finds data in both fields, then I want to make a change to the EnrollmentID row of another table to changed the graduated column from No to Yes.
To expand on that, I'll want to check each ClassID row and if all of the associated students of that class have the column Graduated checked as yes, it will place the date in the date column for that particular class.
This is essentially my way of auto-archiving data as the combo box selections on my forms don't allow for class data to be shown if there is a Closed Date entered for the class and you won't be able to enter more test results for a student if the Graduated Column is checked in the Enrollment table (associates memberID, ClassID, CourseID into a single table)
Any insight on how to do this would be greatly apprecaited.
I would be really grateful if anyone could tell me if it's possible to have a horizontal scroll bar on a form that only moves part of the form's contents... similar to the freeze panes option in excel.
Obviously vertically you can use the form header and footer, but there doesn't seem to be anything horizontally that is equivalent.
I am trying to open a form in design mode and add controls, this i have done. I am doing this all in a class, and am having trouble saving the modified form.
I have tried using the following, both produce errors
I have a timer form which closes the database after a period of time with DoCmd.Quit. Another form is open at this point but if a user has left it in the middle of editing it I want to be able to save the record in the other form and close it before the timer form closes the database.
What VBA do I need in the timer form to save the record and close the other form before DoCmd.Quit? Just to be clear the code is...
Private Sub Form_Timer() On Error Resume Next Me.Tag = Val(Me.Tag) - (Me.TimerInterval / 1000) Me.Caption = "The database will exit in " & Me.Tag & " seconds" If Val(Me.Tag) <= 0 Then
Is there a simple way to make sure all fields on a form are filled before the data is saved to the table? I looked into using thew IF is Null Then but for 30 fields that is alot of code. Does anyone know a easier way?
Hello, I have a form and I have a button so people can open records to load into the form. The problem is that whenever they close the form it updates the information in the table. How do I stop that from happening? I want the information in the table to update only when they hit the button I made (which works).
And how do I stop it from loading the record when I open the form, or maybe I can specify to load a blank record instead, how do I do that?
I would like to have one stupid question, because I could not find any answer on this forum. I want save the Form as Report. I can do that from "Menu bar", but I want to do that from the code (VBA or Macro) without inputting the output parameters by users. Do you have any idea how?
Hi I have created a form which I would like to save, and use as my own template. This is because the form is linked, and when I try to make any structural changes to the database, I have to delete the link, start again, and then redesign the form. Is there anyway I can save the form, to use again, instead of starting from scratch? Thanks so much! Hayley
Got a quick question, is there a way to have a field in a subform update a field on the primary form's table? In other words, enter the data once and it stores it twice, on the subform table and the primary form table.
I was just wondering if it's possible to save a form with all its settings and selections, and reload it later? So if a user is filling a form out with a few subforms which show a yes/no field in datasheet view, if they select a few options in the yes/no field and hit save, when they reload, it will bring up the form with everything they had selected when they hit save. I'd like to put Save and Load buttons on my form if it's possible.
I have a simple form with a save button created directly from a table. I would like the on click event to check 4 fields to be sure that they weren't left blank and have a msgbox prompting to fill in the missing data, obviously not saving until all fields are complete. Fields are FirstName LastName Age Position. If all data is filled I would like the button to save the record and begin new record.
Help!! I have a form created on a query. I created a field to add up the cost of all components on the form and now I need to save it to a field in a table so that I can run a report (my invoice)! Any suggestions??
I am trying to make a database for a shop which can do several things:
1) I want to give in what is being bought by the shop to make their products form. This has to be saved in a table named STOCK.
2) I want to be able if I say in a form that from these things I made that product that these things dissapear from the STOCK table and that the final product is added to the STOCK.
3) If the final product is solled I want to remove it from stock.
In the end if I want to see what is still in the stock I will only have the things that are still there because the rest is removed.
I have a form that has a bunch of project information and scrolling buttons at the bottom to browse by next/last.
Right now the form is sorted by the ID associated with the project, which kinda sucks because they were and are not put in alphabetically.
I discovered if you right click on a field and click "Sort Ascending" or the opposite it works fine but when I open the database it is right back to normal ID sort
I have checked the Data and Other tabs but can't find anything with regards to this as well as I have tried sorting the actual table by name and that changed nothing.
In my database I have a button on a form which leads to a subform popping up. On the subform popping up, I display data from the first form. However, unless I first save the original form and then go to the subform, the data isn't passed on. How can I make the button both open up the subform and save the form so that the data is passed on?
I have a form and one of the fields is a drop down box with autofill. If I enter an information that it is new, it doesn't show in the drop down box even after I click on the Save button I created on the form. In order to show up, I need to close the form, then reopen it again. I am running this particular drop down box from a query in order to facilitate the autofill and because it also automatically fill other fields when the information has been already entered. I also tried linking the drop down box directly to the table instead of the query, but it did not worked. So basically my main problem is that in order for the new information to appear in the drop down box I need to close the form and reopen it. Any ideas what can I do here? Thanks
Hello, I'm creating a database to enter Tests that have been done. I am recording the date that the test was performed and now I need Access to tell me when the next test is due (i.e. 5 years from the latest test date). I used the expression dateadd("yyyy",5,[NextTestDue]). But when I put this under Control Source, it only displays it on the form but does not save it in the table. How do I get it to save the info to the table?
I need the NextTestDue field to automatically populate when I enter a test date (The date the test was performed). Please help.
I am working with Access 2003 and want to save the sort order in a subform. The new sort order would be different from that of the underlying table. The Order By property has been set but isn't working the way I expected. I have tried replacing the underlying table with a query but that hasn't worked out either. I don't want to change the order of the table because other programs that access it would be affected.
I've been reading about an Order By On switch that might do the trick but apparently it's not contained in Access 2003. There must be some other way to skin this cat!
I have a form with only 2 fields. One field is a drop down (Yes, No, N/A). The other field reads the first field and then assigns a value using an IIF statement (If No, then 0, otherwise 1).
I want to run a query on this data, but when I do, the 2nd field's result doesn't appear in the query (nor the main table).
How do I save/record the result from the 2nd field in the form to the table?
I have a form that has unbound text box controls. The user enters numeric data in each of these text box controls. I want to be able to store the values that the user enters for future use. I am using the following code which was provided on Richard Killey’s web site. The problem is that the values that the code stores in the unbound text boxes is populated back as text values rather than numeric values. Here is the code that saves the values. Code:Private Sub cmdSave_Click() '--- only process Save if there is data in scheme name If IsNull(txtScheme) Then MsgBox "Please Enter A Scheme Name" txtScheme.SetFocus Exit Sub End If Dim rst As Recordset '--- use the primary key (which is always an autonumber field) to find the record '--- if it is a new record, this will find no records, as txtID will be 0 Set rst = CurrentDb.OpenRecordset("select * from tblschemes where ID=" & txtID) If chkNew = True Then '--- do we add a new record and save an existing one rst.AddNew Else rst.Edit End If '--- transfer data from text boxes to table fields rst!MVol = txtMVol rst!TVol = txtTVol rst!WVol = txtWVol rst!ThVol = txtThVol rst!FVol = txtFVol rst!SVol = txtSVol rst!SuVol = txtSuVol rst!Scheme = txtScheme rst.Update '--- save the record rst.Close '--- close the recordset Set rst = Nothing '--- reclaim the memory the recordset was using chkNew = False '--- reset the new flag '--- enable the list box and the Add New button and the Close button '--- must be done before moving focus to the list box lstData.Enabled = True cmdAddNew.Enabled = True '--- make sure the newest data is in the list box lstData.Requery '--- set the focus to the list box lstData.SetFocus lstData = lstData.ItemData(0) Call lstData_AfterUpdate '--- disable the text boxes and the Save button, and make Edit button enabled txtMVol.Enabled = False txtTVol.Enabled = False txtWVol.Enabled = False txtThVol.Enabled = False txtFVol.Enabled = False txtSVol.Enabled = False txtSuVol.Enabled = False txtScheme.Enabled = False cmdSave.Enabled = False cmdEdit.Enabled = True End Sub And here is the code that populates the values back into the unbound text boxes after an update. Code:Private Sub lstData_AfterUpdate() '--- whenever a new item is chosen in the list box, display the data in text boxes txtScheme = lstData.Column(1) txtMVol = lstData.Column(2) txtTVol = lstData.Column(3) txtWVol = lstData.Column(4) txtThVol = lstData.Column(5) txtFVol = lstData.Column(6) txtSVol = lstData.Column(7) txtSuVol = lstData.Column(8) txtID = lstData.Column(0) '--- primary key is in the first column (always) End Sub How do I change the code so it stores the values as numeric rather than text ? Thank you for any help that can be offered.
I have created a form with data pulled from tables and queries, I need a way to create a submit button and have it saved to a table I have created. and also clear the data from the form, also to give a warning if not all fields have been filled in. the Form is frmTM and the table that I need it sent to is Team Member Data.