I need a pop-up form that is based on an if then statement.
For example if there is a certain customer selected on the form and the detailed bill is more than 10 lines long (I have a count field) then I need a box to pop-up that says....
REMINDER: You will need to manually reformat this 500byte file.
I also need another one that pops-up when the record loads that warns if a purchase order field is blank.
In an access form, I have several checkboxes. There is one checkbox titled "Complete". The complete checkbox needs to be true only if all other "non master" checkboxes are true. If all of the non master checkboxes are not checked, I need the complete checkbox to be false. This is the code that I am currently using on the after update command:
If me.checkbox1 and Me.checkbox2=True then me.completed=True else me.completed=False end if
This works fine if there is no "and" in the if statement and the condition is based on the status of one checkbox as opposed to many (Also I have about 15 checkboxes that must be checked before the "complete" checkbox is true).
I have a form which uses a parameter based query to present an individual senior doctor with a list of names for of individual juniors to provide an assessment report on. When the first form opens the user enters their RespondentID.
Once senior has decided which names to comment on I have another form which has the questions to be answered which is opened by clicking a button on the first form.
How can I pass a parameter from the first form to the second so that only the records relevant to that senior doctor are displayed? The underlying table has 60 senior doctors and 20 junior doctors. The senior doctor is identified by the field RespondentID in the first form. I've tried putting a WhereClause in the FormOpen command but I still get a dialogue box asking for the parameter RespondentID when the second form is opened.
I have a continuous form sfrmAddress which is based on my table tblAddressList. What I am trying to achieve concerns the date fields DateFrom and DateTo.
DateFrom is a bound text box txtDateFrom
I am trying to put an IIf function in the Control Source of unbound text box txtDateTo
qryAddressHistory1 returns the LatestFromDate , so the most recent address.
The idea being if it is their most recent address, they have lived there until today, if it is not their most recent address it will display the date contained in the table (when they moved out or DateTo).
I have tried this a few different ways, double and triple checked my references and I'm usually OK with IIf so I don't understand where it's going wrong!
I should add I'm getting the #Name? error all the way down the column when I open the form.
I want to create a button that executes an SQL statement in a form. The reason I can't just save a query and run the query from the form, is because the SQL statement needs to use a combobox value from the form. I've learned that docmd.runsql will not work for a simple select query.
I have a form in my Access database that has 3 input boxes by which a user can locate a record by. The problem I am running into is that I can not get a nested IF statement to work properly to first check which of the search boxes are filled in and second search by whichever is filled in. I have come up with the following code that seems to be only searching by the first input box. If the first input box is blank it does not move to the second or third numbers so I imagine there may be something wrong with the order of my IF statement or the syntax is off.
I have a form based on a query in datasheet view. What i would like is to show only those records that fulfill the truepart of iif statment, and do not show the ones that fulfill the false part.
I have the following fileds in the query
month currency 1 checkbox currency 2 checkbox sum
In the form, the control named month contains the following code:
control source: =IIf([checkbox1]=no;[month];0)
So this gives the appropriate months, but also shows the all other records with a 0 in the month field. I would like to get only the records shown that are correct with the truepart of the statement.
Basically I have a Customer Form, which I have a New party button on it,this button opens up the party form to a new party, what I would like it to do is open up a new party but make the new party for the customer I had selected in the previous form.I have tried the GoTo macro's but cannot seem to get it to work.
I am thinking on clicking the button it will need to get the Customer ID, and then open the party form, create new party, and paste in the Customer ID, which then updates the Name - Date - Address - Company Fields.
I am trying to write an expression that will result in a date in the format (mm/dd/yyy). I want to display the curent day if it is before 11:00 am based on the system time, and the next day if it is after 11:00 am. Below is the expression that I currently am working with... but it is not working.
I'm trying to get a combo box & button to work together. On the main form of the attached database, I just want the button to go to the associated record based off my selection (or entry) in the combo box.
I've tried the following:
- Looked through the Northwind sample database for a close example. Tried my best to replicate the functions but it didn't work - Looked through other examples posted and tried to manipulate the code to no avail - Tried using [Forms]![Main Form]![cmbLastName] in both the filter & criteria section of the macro
I have one table containing name of restaurant with its address etc. Then i created another table to list out the restaurant workers names and details. Just as an example,
Table:Restaurant Restaurant name Address line 1 Address line 2 Restaurant # Website
Table:StaffContact Staff Role Name speciality email phone
I have the main form that has all the restaurant details only. And i have another form containing the Staff information. Please note the two table have a relation and it works well.
Now to make it user friendly(basically easier for the lazy ones), I dragged the staff contact form on to my main form and displayed it as a datasheet(basically a sub form).
Now, my boss does not want users to add/delete on this sub form(datasheet). So,he wants me to create buttons to open new record of staff for each restaurant(new form)
My issue is with opening a new record to enter a new person to the staff list and give them a role as well in form view.The new form has
So i ran a Macro, with open form with Where condition
The user will be creating a new project that contains a bunch of releases. The releases have standard names which are stored in a table tbl_ReleaseNames It should be noted that the list of names is not static.
The user selects which of the releases pertains to their project and then based on their selections, new records would be created in tbl_RFP_Release and then a subsequent form would open where it would display each of these newly created releases where they could enter additional information. I thought of creating an unbound checkbox associated with each of the standard names, and then checking to see if the checkbox was checked and then creating the new records followed by opening up the new form.
I have a form with a check box. A query is run that looks at that check box and decides what the criteria are based on that. So, if the check box is checked, it should pull in all data in the field that is a Y. If it is not checked, i want it to pull all data (Y's and N's and blanks).
I have a complex IF Statement within VBA. When I step thru the code the if statement variables should return true but instead treats it as False. See '>>>> this happens on the 2nd Pass of a Do Loop Statement, the First Loop the if Statement Returns True
Variable Values:
Record 1 contractNo: 00001634 nfld: 33.40% nTier6: 30.00%
Record 2 contractNo: 00001634 nfld: 137.52% nTier6: 28.50%
so the 2nd if should be true but it acts as false an moves to next If statement.
Code:
If nfld = Format(0, "Percent") Then nOvrAmt = 0 BkOvrCalc = nOvrAmt GoTo cont: '>>> ElseIf nfld > nTier6 Then nOvrAmt = rs.Fields("TotalNetUSExp") * rs1.Fields("T6E").Value
I have two text boxes for which I am trying have show and error message when the proper data is not entered. One text box is for PLANID and the other is for Date. I would like the PLANID to be checked 1st. The PLANID needs to be either 7 digits or 10. If it is not, the message would be "Please enter a valid PLANID". If it is 7 or 10 digits, then it should check the Date text box.
If it is blank, the message would be "Please enter a valid Date". If they are both blank, the PLANID message should appear 1st. Below is what I have written. The problem that I am having is that when the PLANID is 10 digits and the date is blank, the "Please enter a valid PLANID" message is showing rather than the "Please enter a valid Date" message.
Private Sub Btn_Refresh_Data_for_One_Plan_Click() Me.txtboxPLANID.Value = UCase(Me.txtboxPLANID.Value) If ((Len(Me.txtboxPLANID.Value) = 7 And Len(Me.txtboxPLANID.Value) = 10) And (Not IsNull(Me.txtboxPLANID.Value)) And (Not IsNull(Me.TxtboxDate.Value))) Then Dim stDocName As String stDocName = "Mcr_RUN_MATCH_DIFFERENCES"
I have a button that opens a second form and filters that form based on a text box on the first form(which remains open). the problem is that it does not filter the second form unless the second form is already loaded for some reason.
For example if i click on the button it opens the form Unfiltered then i go back to the previous form without closing the first form, click the button again and it is then filtered .
I attached the screen shot of the macro for the button and there are no other events on the second form.
When I have a form called "SiteForm" open and click a button "NewCalloutButton" I would like it to open up a form called "CalloutFormEntry"
I've done this using
Private Sub cmdOpenDetail_Click() DoCmd.OpenForm "CalloutFormEntry", , , "CalloutID = " & Me!CalloutID End Sub
However this brings up all the records linked to the calloutID
What I'm after is to open the CalloutFormEntry from the SiteForm in a dataentry kind of format but to carry over the current SiteID based on which site is open on the SiteForm. That way there's no user error logging callouts to incorrect sites.
In a form, the value of any field may determine if the other field will be true or false. For example in my form, inventory, if value in code is equal to 2 then the Field Table will be automatically false.
I have an AfterUpdate event where I want a list box to be populated based on three different criteria based on a table in my database
1. Complete = False AND 2. Supplier on form = supplier in table AND 3. Status in table = "SUPPLIER_RFQ FOLLOW-UP" OR "SUPPLIER_RE-RFQ TO OTHER SUPPLIER"
I am having trouble with the last OR statement criteria, i cannot get this to return values correctly. Here is my code:
I have a lengthy CASE statement in my database that displays specific text in a field based on the value of another. Simple stuff but for some reason it randomly will not work on certain values, and never the same one twice. Is there a commonly known cause for this? I have verified that the spelling and spacing etc. are correct in my code so that shouldn't be causing the problem.
I would like to have a table update query populate cells in a field, based on an IIf statement (below), but states that the IIf statement arguments still need to be enclosed in parentheses. I don't understand what the problem is, I have two sets of opening / closing parentheses.