Open A Form Depending On Conditions

Feb 21, 2005

I have a search form, that can be opened by both my "product_enquiry" and my "edit_product" form.

When you select a value on the product search form, i want it to open another form at a specific record.

Easy you might think, but what If i want it to work out which form to open.

So if: A button on Edit product was clicked on to open product search, the value found in product search should be loaded into edit product.

But if it was a button on product enquiry, the record should be opened on the product enquiry form.

Can anyone help?

View Replies


ADVERTISEMENT

Open Form On All Conditions Met

Feb 9, 2008

Hi,

i am trying to open a form if all conditions are met. if the conditions are not met, then they get a flash message and then the user should return to the open form. i have the condition checking working but cannot seem to open the form if ALL conditions are true. i also need to close the form when the new form opens.how could i achieve this? here is my code

Private Sub MidVerifyContinue_Click()

FullNameChk.SetFocus

If FullNameChk = False Then
MsgBox "You Need to have a Full Name to Verify", vbOKOnly, "Message"
End If

If CompNameChk = False Then
MsgBox "You Need to have a Company Name to Verify", vbOKOnly, "Message"
End If

If TradeNameChk = False Then
MsgBox "You Need to have a Trading as name to Verify", vbOKOnly, "Message"
End If

If UTChk = False Then
MsgBox "You Need to have a number to Verify", vbOKOnly, "Message"
End If

If CRChk = False Then
MsgBox "You Need to have a C R number to Verify", vbOKOnly, "Message"
End If

If NIChk = False Then
MsgBox "You Need to have a N I number to Verify", vbOKOnly, "Message"
End If

If PostCodeChk = False Then
MsgBox "You Need to have a Postcode to Verify", vbOKOnly, "Message"
End If

Exit Sub


DoCmd.OpenForm "New Verification Qry"

End Sub


many thanks,

Nigel

View 8 Replies View Related

Open A Form Depending On Selection Off List Box

Aug 23, 2006

Hi

I have a form, with 2 Combo Box's and a List Box. The Combo Box's provide a search criteria and the results are displayed in the list box [searchList].

I want to be able to double click a record in this List box [searchList] and that will open a from [frm_SearchDisplay] with the selected record from that List Box [searchList]

Can someone please point me in the right direction.

Thanks in Advance

H

View 2 Replies View Related

SIMPLE VBA Open Form Depending On Yes/No Reponse

Oct 12, 2006

Can someone please help !!

I have a table with four 'Yes/No' fields.

I have four forms (each form 'relates' to one of the 'Yes/No' fields) and contains additioanl information to be completed.

When I create a new record in my database I tick one, two three or all four of the 'Yes/No' fields.

I would like some VBA code that will automatically open the relevant form (depending on wether the 'Yes/No' box has been ticked) when I click a button.

Many thanks.

View 1 Replies View Related

Forms :: How To Open Form Depending On Field In Subform

Sep 22, 2013

I have a Table table_clients and a connected table (1-->many) table_invoices.

I have two forms:

form1(table_clients): all clients with subform1(table_invoices): all invoices for every client

the form2 and subform2 are the same, just objects are placed differently on page.

I want when I have opened a record on form1/subform1, to be able to click a button and open form2/subform2 filtered by the invoice_id and the client_id.

View 13 Replies View Related

Multiple Conditions For Form

Apr 11, 2006

G'Day:

I have a form that I created that allows the user to input an "ExhibitNo" and then a "PlacingNo" to allow each entry to receive a set monetary amount (based on values in a table).

The "ExhibitNo" has two references linked to it. They are "ClassNo" and "ExhibitorID".

My supervisors want me to make it so that when the "ExhibitNo" is entered on the form that it will not allow a monetary amount.

This is where I started, but it does not work. Does anyone have a better idea?

Private Sub Combo14_AfterUpdate()
Me.Refresh
If [ClassNo] >= 0 >= 5000 Then
If [ExhibitorNo] <= 0 >= 499 Then
If [Placinggrade] = "Blue" Then
[Premium] = [Blue]
End If
If [Placinggrade] = "Red" Then
[Premium] = [Red]
End If
If [Placinggrade] = "White" Then
[Premium] = [White]
End If
End If
End If

If [ClassNo] >= 5000 Then
If [ExhibitorNo] <= 500 Then
If [Placinggrade] = "Blue" Then
[Premium] = [Blue]
End If
If [Placinggrade] = "Red" Then
[Premium] = [Red]
End If
If [Placinggrade] = "White" Then
[Premium] = [White]
End If
End If
End If

If [ClassNo] >= 5000 Then
If [ExhibitorNo] >= 500 Then
[Premium] = 0
End If
End If

End Sub

Thanks

View 1 Replies View Related

Hide Form When All Conditions Are Met

Jan 23, 2007

What I need to do is, not have a form pop up when all the conditions are met. I have 30 some users that log into the db.

I have a form that pops up when the date of the project is past due. to certain users when they log in. I am using the Environ("username") theory, which works very well. But when the user has COMPLETED all the necessary dates, the form still comes up, (but of course it’s blank).

How can I eliminate that problem?

View 5 Replies View Related

Requery Form With Previous Conditions

Feb 28, 2005

It's easiest if I take you through step by step. I open a form with a list of students and I have to enter the condtion for a Tutor Group (say I type in 13EN). The form then loads up with all students in 13EN. Then I have a 'Add Student' button which loads up a form with an indivudual students information qith a blank record. Then I press a 'Done' button which closes that form and requeries the Student List form.

My problem is when I requery the form I have to re-enter the condition for 'Tutor Group' i.e. I have to type it in again. Is there any way I can refresh the data from the conditions I have already entered (i.e. for the Tutor group, 13EN) without having to type it in again?

Thanks

View 2 Replies View Related

Forms :: Filter Form With Multiple Conditions?

Mar 12, 2014

I want to open a filter form with mulitple conditions.one of them is a date condition.

I'm using access 2013 and the code below:

Code:
DoCmd.OpenForm "Edit_Mission", acNormal, , "[Report_Date]= " & Me.Date & " And [Supporter_Name]='" & Me.Supporter & "'"

it's opens the form but with no data. I also tried the # and it's still didn't work.

View 1 Replies View Related

Sub Form Increase In Size Depending On Data

Sep 29, 2006

I have a main form with a few imbedded sub forms.
Sometimes these is a great deal of data in one of the sub forms & non in the others.
Is there a way that the sub forms can grow depending on the amount of data there is in each particular sub form. (The sub form grows for a lot of data & shrinks for little data)
The way I have it now is that each sub form is always the same size and a scroll bar appears when these is extra data. This is OK but I need to see all data in sub forms at once if possible.
Can anyone help with ideas please?

View 2 Replies View Related

Load Record To Form Depending On Value In Combo Box

Oct 10, 2007

Hey,
I have 2 combo boxes. The first one gives a lis of Prefix letters for railcars. The second uses the value of the 1st and finds railcars that start with the same letters.

finally got the 2nd combo box to list the prefix and number of a railcar based on the 1st combo box and also got it to clear as each run-through starts.

Now that the user can select a number (ex. dfcv1234 as the railcar), I need to find the record with the prefix dfcv and the car number 1234 and load the record to the form for view and editing.

So far, I know it needs to be the after update event and have a select statement that finds the [key], [prefix], [car_number] that matches the value selected on the form but how do I use the key to make the record show on the form?

Thanks,
slh

View 5 Replies View Related

Forms :: Vary Sub Form Labels Depending On Other Value

Jan 21, 2015

I have a form containing a sub form.

On the sub form I am selecting products that I am selling to a customer whose details appear on the main form.

The products on the sub form are selected from a combo box. This section is in datasheet format.

Depending on the product sold some of the labels on the sub form are not relevant. And when this is the case I was thinking maybe the label is rendered invisible.

Maybe this is not the best way to handle this - or is it. It certainly is expedient.

Perhaps as well when the label is rendered invisible entry of a value into the corresponding text box becomes impossible.

Is there a better way to handle this?

How I can render the label invisible and disallow data entry depending on the value of the combo box.

View 6 Replies View Related

Modules & VBA :: Conditional Form Formatting Depending On Field

Jul 2, 2013

I created a form that applies conditional formats depending on a field. It works fine, until you enter data into one of the conditionally formatted fields, then all hell breaks loose. Conditional formats totally go away and the cells go to #error.

View 3 Replies View Related

Modules & VBA :: Display Text Depending On Combo Box In Different Form

Aug 6, 2013

I want to display the text from one combo in a text box in another form based on what's selected in a second combo box. The text box is in a different form from the combo boxes.

Sub D_ComponentTypeCmb_Change()

If Me.D_ComponentNameCmb.Value = "Customise" Then
Forms!CustomComponentF!C_ComponentTxt.Value = Me.D_ComponentTypeCmb
Else
Forms!CustomComponentF!C_ComponentTxt.Value = ""
End If
End Sub

View 13 Replies View Related

Forms :: Disabling Subform Depending On Main Form Value

Jan 9, 2014

I have a mainform called frm_Main containing the field AgeCalc

I then have a a subform which has some tabs, one of those tabs contains a subform called frm_Bans.

If the AgeCalc field is <17 I want to disable the subform frm_Bans.

View 4 Replies View Related

Forms :: Text Box Background Color Depending On Its Value In Continuous Form

Jul 13, 2013

In Access 2007 (or 2010 , 2013), in a continuous form, I want to change the background colour of a text box depending on its value. Obviously, for each record, the color can be different.

View 1 Replies View Related

Forms :: Display Certain Fields On A Form Depending On Criteria In Another Cell

May 6, 2013

I would like to only display certain fields on a form depending on a criteria in another cell. For example if some enters 4 in 'Schemes' it would display 4 data entry boxes scheme1, scheme2, scheme3 etc - is it possible?

View 7 Replies View Related

Forms :: Adding Combo Box To A Form Depending On Input Values

Sep 23, 2014

I want to add a combo box to a form, where depending on the values entered in the box another combo box would show more values. In other words, if the first combobox had choices of 1, 2, 3 and 4, if 1 was selected the next combo box would have values a, b, c and d. If 2 was selected, it would have values of a, d, e, f and g.

View 2 Replies View Related

Making Form Buttons Visible/Invisible Depending On The Contents Of A Field

Oct 23, 2004

I am trying to make a button on a form visible and invisible dependant on the contents of a field in my form, any ideas?

View 3 Replies View Related

Forms :: BrowseTo Opens Form As NewRecord Depending On Opened Record

Apr 2, 2015

I'm using a navigation control to switch between forms. In one of those forms, I have a continuous subform which is a list of Projects (source is a query) that is read-only. To edit a project, I can click on its name, which switches the form displayed in the navigation control via docmd.BrowseTo (with acEditForm as the last parameter). This works fine. The proper form opens, with the proper project being displayed.

Now, on this second form, I have on the right the list of tasks contained in the project in a continuous subform (source is a query), and on the left another subform which is kind of an "edit bar" that I use to actually edit the individual tasks. So, when I click on a task in the task list, the OnCurrent event triggers a docmd.BrowseTo command that updates the "edit bar" subform and passes the ID of the task as the WhereCondition parameter. This updates the values displayed in the Edit Bar to that of the selected task, which I can then edit.

Now here's the thing: depending on the project I open, the Edit Bar doesn't work. Actually, it looks like only one of the projects is working, while the others are not (and I managed to have a different project working, but only one works at any given try). When it doesn't work, the Edit Bar is in "NewRecord = True" for some reason. All the other properties of that subform seem to be the same between when it works and when it doesn't.

So, it looks like the same command (docmd.BrowseTo with acEditForm) opens the subform properly in acEditMode when it works, and in something else when it doesn't, depending on the parent record that's being opened.
This really gets me, I really can't figure out how that's even possible.

I suspect it might have something to do with locked records, maybe?

View 2 Replies View Related

Forms :: Form That Adds Data To A Table Depending On Which Option Was Clicked In Combo Box?

Sep 30, 2013

i have a standard database with tblProducts, order, employees, customers, suppliers etc. i also have a table called tblperson with personID which acts as a one, with the many in three different tables (customers, suppliers and employee) the person table holds data such as first name last name address city postcode and phone. now, ive created a form called frmPerson that acts as a adding data to my database. ive got a load of buttons a working add, delete and a save button, i also have the option to switch through records next, last, end and first. now basically in this form i want to be able to add data i.e. fill out the text boxes and then have a combo box or something similiar that when i add the data i can basically click an option the says 'employee' 'supplier' or 'customer' and then the data gets added to my person table however the difference is that it will also be associated to the record in the wanted table.

View 14 Replies View Related

Forms :: When Open A Form / Want To Open Another From At Same

Jan 14, 2015

when i open a form i want to open another frm at the same time. i have a main form with some buttons in it. when i click on a button and a form opens then i am not able to click on a button to open other forms from the main form.

View 2 Replies View Related

Closing An Open Form From Another Form That Is Open

Dec 17, 2004

Is there a way to close a form that is open from another form that has the focus. I tried using the Unload event, but I received an error message "Cant load or unload the object". I would appreciate any help!

View 1 Replies View Related

If 2 Conditions Are Met Then

Feb 26, 2007

I am trying to write a code that will enable an event to happen if 2 conditions are true, something like:

If [DueDate] >= [CurrentDate] And [EndDate] is Null Then
Event ..... take place

I tried above and did not work

it works only if write one condition of above

how can I set it up correctly

View 5 Replies View Related

Help With Conditions

May 26, 2005

I currently have a query which takes its criteria from a form called search. This all works fine, unless the user leaves a field in the search form blank. Then the query has no results.
What I'd like is for a blank field to act as a wildcard.
I guess the reason this doesn't automatically work is that Access (effectively) puts " & " around the criteria taken from a form, so the criteria ends up as " " not (there's a space there!).

I tried entering a criteria in the query that says:
IIF([Forms]![Search]![Date] Is Null,*, [Forms]![Search]![Date]
this doesn't work. For one thing Access edits the * into "*", so it is no longer a wildcard. Secondly, I've never used IIF before, so it's probably wrong anyway...

So, can anyone help me do this?
Even if a blank field cannot be used as a wildcard, any character would do...

View 2 Replies View Related

IIF With 2 Conditions?

Aug 15, 2007

Hi

Hope someone can help with this. Had a search through the forums but nothing quite the same (although I'm guessing it's a simple one to solve.)

I need to calculate a figure based on 2 criteria. The permutations are as follows

If condition A is less than 20 and condition B is No then return 9
If condition A is less than 20 and condition B is No then return 12
If condition A is greater than 20 and condition B is No then return 13
If condition A is greater than 20 and condition B is No then return 15

Any suggestions?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved