I have three questions, both im sure are easy just overlooking something.
1) I have a search form where you type the search parameters into 3 fields, and then your click search. I want the fields to automatically clear after the search button is clicked (but enough time for the query to get the info from the fields).
2) A combo box is used to select the marketing type, when first clicked.. a dialog box comes up and gives the user instructions for the next blank. After the field is changed to the right selection, i need it to automaticcaly forward to the next box.
3) I need to use a text box to sure information. The table records only 1 line of text, does that mean you cant have 2-3 lines? Really just 1 line wrapped in the window?
I have made a form with a subform to search for existing records based on inputting a postcode then selecting the relevant address from the subform which then fills the form with details of that chosen record ready to issue a further package linked to that original record.
To prevent errors and confusion by the users I coded the following:
Private Sub CmdFindAddress_Click() If IsNull(Me.TxtPostcode) Then MsgBox "You need a Postcode to use this button. Please type one in." Me.TxtPostcode.SetFocus
[Code] ....
'Where the postcode entered does not exist in records or if there is a mistake typing in the postcode, below will remove residual record details from previous postcode ready for a new postcode search:
For Each ctlCurr In Me.Controls If ctlCurr.Tag = "clear" Then ctlCurr = Null End If Next ctlCurr Me.Refresh End Sub .........
The problem is that if I test the system by inputting a postcode where I know there are no records, the CtlCurr is highlighted and the error message is:
Compile error: variable not defined ..........
This does not happen if I have already selected a postcode so the record fields are filled and then change the postcode - so the record fields are cleared.
Previously, entering a postcode which did not match existing records generated the "there are no records...." error message instead. How do I define CtlCurr?
I am currently working on a main form in Access 2010 which includes quiet a lot of fields, therefore i choose to create parts of it (which are as well optional, as they do not apply to all records) as different forms which i linked to the "mother" form afterwards through a checkbox by using the following code:
Private Sub chkMajor2_Click() Dim strformname As String If Me.chkMajor2 = True Then strformname = "Major 2" DoCmd.OpenForm strformname, acNormal End If
[code]....
to make the next form visible for selection after filling in the current one...something like an "add more.." field actually, which i choose to represent as checkbox.The issue that i encounter is that when i click the "Add New" button in the main form, it doesn't clear also the fields in the linked forms. Is it possible to do that with a VBA code? Or how should i proceed?
The current code that i have for the button is:
Private Sub cmdNew_Click() DoCmd.GoToRecord , , acNewRec End Sub
I have a timesheet form that pulls from a query that pulls from a table I want to clear my daily charges and reset back to the default value of 0 when my form opens ...
Created a button through button wizard that is supposed to open a form to add a new record, but all of the fields don't clear out. Only some fields clear and other fields actually populate data from another record.
Snip1 shows my form with a record selected. When I click the 'New Waste' button, you can see that the record ID goes to '(New)', but the fields actually populate data from another record.
This even happens if I set 'Data Entry' to yes for the form.
here's the code behind my button:
Code: Private Sub btnNewWaste_Click() DoCmd.GoToRecord , , acNewRec End Sub
I even commented out my code for duplicating my record just in case but that didn't make a different.
Code:
Private Sub btnDuplicateRecord_Click() Dim ctrl As Control For Each ctrl In Me.Form.Controls If ctrl.Tag = "DefaultMe" Then ctrl.DefaultValue = """" & ctrl & """" End If
[Code]....
edit: this problem persists in a backup database that only contains one test record. The button pre-populates data that doesn't exist in the back-up database.
I am working on form where the user selects either "IN" or "OUT" from a dropdown of field name "CheckOut" in Frm1.
If they select "OUT" they will in turn need to fill in 2 additional fields. When they change the value back from "OUT" to "IN",
I want those other fields to be cleared of data for just this record so next time they change back to "OUT" from "IN" those 2 additional fields are already blank.
I don't have any database experience whatsoever so please go easy. I'm guessing this kind of this is extremely simple for all of you.
I'm constructing a database of network resources and devices and I'd like to automatically update the values in one field based on the values of a field in another table.
The first table is called "IP" and the fields are called "Address", "IP Type" and "Device". The second table is called "Devices" and contains the fields "Name", "Description", "Asset Number" and "IP".
Here's an example of the tables: (ignore the "code" tag. i've only used it to align my columns properly)
What I want is for the Device field in the IP table to automatically update it's values based on the values found in the Devices table. In this case, the values that should appear in the Device field in the IP table are "Xserve" and "ProliantX".
I've searched through but haven't found a complete solution, just little pieces which I'm too inexperienced to put together myself.
I have main form and that has one sub-form , this Main form governs/determines the data in the sub form.
This Sub form ( DataSheet Mode) has approximately 130 columns and based on the Main form criteria only ~ 20 columns has to be filled.
What I want to do is based on the main forms criteria I want to show only the columns that are applicable to main form criteria.
If I use Columnar or Tabular single form for the Sub Form I am able to hide the fields that are not required BUT IT LEAVES A SPACE/GAP on form ( for the hidden fields that are not required)
Private Sub Form_Load() If Forms!frmShowPIforActiveAndCanAddNewPI!FrmSubFrmFi lterProductInformationPerFMT!CASETIF = True Then
Me.CASETIF.Visible = True Else Me.CASETIF.Visible = False End If End Sub
And If I use DataSheet and hide ( visible = no) a particular filed it still shows up in Sub Form
Is there a way to Auto-Re Arrange all the fields in the sub form so that the hidden ( visible = no) fields no not leave gap
Or is there a way by VBA program to select fields ( Columns) from a table to be displayed on a sub form based on a criteria
How can I get some mainform fields' data to be the first entry in a subform? From the mainform, I would like the Head of Household name and date of birth to be carried over to the first entry in the HouseholdMembers subform.
The two forms are tied to separate tables. For each household member I need to be able to enter full legal name, date of birth and some additional pieces of information such as income and source of income.
What I'd like to avoid is making the users enter the Head of Household's name and date of birth twice. Is there a way to carry that information over to the subform?
First post :) found some great tips on here. Anyway here is my story and question.
I am new to Access development. I know what I want to do, I just can not find a way of doing it :( .
1) I would like my form to only be editable when an edit button is clicked. I am not sure if I can do this on a form level or if I have to change each individual part. Any ideas?
2) I capture some clients details, title, first name and last name. I then need to merge the above 3 fields into one to create a 'policies in the name of' field. Is this posisble? I have tried using the initial value expression but am having no luck. Any ideas?
I have a form that currently adds services and products paid for by a client, via subform calculations, indicates payment, via cash, check or charge, and shows, finally, what is still owed. This is for a clinic and some old folks, for example, pay small amounts over time.
The subtotal, sales tax, total and amount still owed are all calculated controls that are functional, but only for the current record. Each transaction record has a date/time field. Each transaction record has the patient ID.
I need to carry forward that amount owed, so that the next time that person comes in, the amount owed control reflects any amount that was owed from the last visit. Is this a case where storing that amount in a field in the 'transactions' table would be justified? Or do I need to somehow incorporate ALL the code leading up to the amount still owed, SUMing it along the way? Very ugly...
Can someone, both, give me some clear suggestions on how to do this kind of running sum on calculated controls (since SUM only works on fields) AND point me to samples of calculated amounts carried forward, if necessary?
I need to use an update query to calculate the following 1st of April for each of 3000+ records, the only exception is if the Start Date is the 1st of April in which case the date will remain the same.
Hi, ive created a balance shee for a football club as a continuous form with a balance being displayed in the footer along with total income and expenditure.
Because this is for a Football Club, I want to be able to do the balance sheets every season. To that end I have a included a date in the query.
Is there a way that I can carry a balance forward to the nesxt season, (next record). I want to display Last Seasons closing balance in the header of the new season and have the new balance include that?
Looking for an automation solution currently I have a database for client progress and prescriptions. when the file is opened it is set for data entry so that a clean note form is opened. I have a button that pulls up past notes for their review. it has been requested that there be a way to pull the last narative field forward to the new record for editing as a number of the features of the narative remain the same. Currently the only way is for them to open the last seen note hightlight the field and past into the new note. to high level for some of them. Need to make this an automated feature where they would just click on a button and the process would all occur behind the scean and the note would apper in the new note narative box. I know that I could tell the form to not be for data entry but then they write over the last note. this needs to be a new record. Any suggestions greatly appreciated J
I used the code in the link below to get the login id returned on a form but I am having trouble now that I rolled out the database the code gives an error if the user has older than 2010 and even on a new machine that has access 2013 what is the best code to use? to return the log in id to a form?? without worrying about what version of access they have it wont be older than 2003. URL...
Once the selected item had been entered, i want the Current_Balance of previous entry of that item to be forwarded automatically in Previous_Balance field. Is it possible? I have at least 100 types of items.
I have a table in MS Access naming "Salutation" and in the table I have 6 columns and each column named as Week No., Carry Forward records, new records, total records, processed records and pending records. Like below
Week No. Carry Forward records new records total processed pending 1 0 10 10 5 5 2 5 10 15 7 8 3 8 20 28 9 19
So now the requirement is every day pending records should get updated in the next row with in the same table under carry forward records of its next immediate day. For e.g. pending records of week number 1 which is 5 should get updated under carry forward records for week number 2 and so on.
I've got an access form, and all I want to do, is to be able to type a number into a text box, click a button and then for the record containing that number to be displayed (in that same form).
-And I dunno where to start.
I don't like using the navigation bar, although that is almost what I'm after.Also, search functions I've seen on here that use combo box lists to display results seem like too much for me, as each number typed into my search box will be unique.
I am a novice with Access and I would appreciate any help with two issues: 1. I am trying to get a value to forward to the next record in a different field so that I may keep a running total. For example: Record 1. A field named Today is added to a field named Forward to get a total in a field named Total. Record 2. I would like to get the value from record 1 in the Total field to carry forward to the the field named Forward in record 2.
The form looks something like this:
Today: 10:00 Forward: 2:00 Total: 12:00
I would like to get the value of 12:00 in record 1 carried forward to the Forward field of reocrd 2 so that the Forward field in record 2 would read 12:00.
2. I also need to add times together arithmatically but the problem I have is that when the total exceeds 24:00 hours it shows only the amount that exceeds 24 hours. For example, if I add 22:00 to 5:00 the result is 3:00 not 27:00. I need to show 27:00 as the total.
Any help with these two items would be GREATLY appreciated. Thanks, uspilot
Could someone please shed some light on any methods on a way to update fields automatically in different tables but with the same field name when data is entered into one of the fields in any table?
I have a 3 forms on is for quotes one is for customers and the last is for actual orders. I have the quote set up that if I put in the phone # which is the primary key, that is automaticly pulls the name of the company and that contact person at the company up for me. But the problem that i am running into is that the table for form for quote is not saving the information so when it auto imputs text it does not save that information into the field on the table. It just leaves it blank. How do I correct this error. Can any one help!
I'm working on a sub-form set to continuous and would like to amend a memo filed so that it autoexpands when entered. Have tried amending the height of the field through the on enter an on exit functions but this alters the size of the form.