Forms :: Testing Subform Conditions

Sep 25, 2014

I do not want to allow the main form record to be submitted unless there is at least one subform entry.Initially I thought it would be as simple as a "Before Update" event which would test the record count of the subform. This works... kind of... not really. It does check successfully, however the conundrum is that if the user has completed the main form and tries clicking INTO the subform to add records, this fires the Before Update event and Cancels the update event.

How can I force a user to complete the subform without running into this issue? I dunno how easy this is to do considering you kind of HAVE to exit the main form to enter the subform, at which point the record HAS to be saved...

View Replies


ADVERTISEMENT

Forms :: Assigning Matching IDs From One Table To Another - Compliance Testing DB

Nov 11, 2013

A while ago I was tasked with creating a compliance testing database for my company's internal processes. For example: Payments, Hiring, Project Management, etc. Right now it's all done through Excel and is structured like this:

Compliance Test 01:

-----|Sample1|Sample2|Sample3|etc...
Item1|GradeA |GradeB |GradeC |etc...
Item2|GradeB |GradeA |GradeC |etc...
Item3|GradeC |GradeC |GradeA |etc...
etc...

In short, a Test has many Items (based on company regulations, like "Has the project been approved by all superiors?"). For each Item you choose a few Samples ("Project A", "Project B" and so on), and for each Sample the user attributes a Grade ("In Compliance", "Not In Compliance", "N/A", etc).

In the Tests mainform, the user fills in the Test details (Tab #1), chooses which available Items he wants to include in his test (Tab #2), details the Samples which will be tested (Tab #3) and finally assigns a Grade to each Item/Sample combination (Tab #4).

Here's what I can't figure out:

In the attached DB, if we go into the "CT - Projects 2013" and check the Samples in Tab#3, we can see they match perfectly with the ones at Tab#4.

Now if we go into "CT - Projects 2014" and do the same thing, we can see that the Samples assigned to the Items in Tab#4 don't match up with the ones in Tab#3 at all. This is because the DB is checking only if the Samples' ItemIDs match with the ItemIDs in the test. But it also needs to make sure that the TestID, the Item's TestID *and* the Sample's TestID match, or it just won't work!

I attached a 2003 version of the database as the first upload used Access 2010.

View 1 Replies View Related

Database Creation And Testing Complete / Will Making It ACCDE Clear Everything Except Forms

Feb 7, 2015

I've created and tested my database. What step or steps do I take now to make it so it's a program that only shows the forms and menu's I created, not all the Tables, Queries etc and the formatting options? Is there a link that explains what to do step by step?

View 2 Replies View Related

Forms :: SQL Statement With Two Where Conditions

Aug 19, 2013

I cannot get the correct syntax for this. The punctuation for the second where condition is incorrect.

Code:
Me.cboDose.RowSource = "SELECT Label FROM tblLookup WHERE tblLookup.[Med]='" & Me.cboMed & "'" AND tblLookup.[Notes] = "Swallowed"

View 3 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

Forms :: Validation Rule With Multiple Conditions

Apr 14, 2014

I have a main form which has couple of subforms bound to one main table. One of the subfomrs is about employment info. It has 3 TextBoxes: (Job Start Date), (Employer Name), and (Wage).

It has also 3 ComboBoxes: (Job Type [Full Time or Part Time]), (Hire Status [Permanent or Temporary]), (Quarter [1st, 2nd, or 3rd]).

I want to force users to fill all these 6 fields if they put any value in any one of them. I tried to set a Validation Rule in the TextBox/ComboBox’s property including IIF statement condition, but I did not succeed, and these rules did not work.I put the following code in the subform’s (After Update), (Before Update), and (On Current) events which works very well when I keep the (Wage) value 0 and move to a new record or to another subform:

Private Sub Form_AfterUpdate()
If Me.[Start Date] > 0 And Me.Wage.Value = 0 Then
MsgBox "You did not put how much is the wage."
Cancel = True
End If
End Sub

[code]....

how to make a similar validation rule for the other TextBoxes and ComboBoxes.

View 14 Replies View Related

Forms :: Can't Give Conditions On Validation Rule?

Jun 1, 2015

Can't we give conditions on Validation Rules? (Like IIf)

IIf(getusername()=[Log_Resource],Between DateAdd("d",-1,Date()) And Date(),Between DateAdd("d",-2,Date()) And Date())

View 8 Replies View Related

Testing

Oct 9, 2004

hi is this working yert?

View 1 Replies View Related

Testing For A Sunday?

Feb 22, 2008

Hello peeps,
I have been working on a hours checking application, in which the user can enter their worked hours for the week and the application calculates how many hours at normal rate , time and half rate or double time rate have been worked for the week. All has been going swimmingly, with some help from here of course :)

What I would like to achieve now however, is, testing for a Sunday. This is because all hours worked on a Sunday, is paid at double time, regardless of the previous hours already worked for that week.

Example if a person worked 60 hours in a given week, there would be 47.5 hours of normal rate, 7.5 hours of time and a half rate and the remaining 5 hours would be at double time rate. But, if a person worked 60 hours in a week and 10 of those hours are worked on a Sunday, this would mean 47.5 at normal rate, only 2.5 hours at time and half rate and the remaining 10 hours at double time.

Therefore, is there a way I can test for a Sunday and perhaps automatically set a flag for the overtime calculation? Or is it possible with DateDiff() function, and if so could someone please assist me with the syntax or at least point me in a direction where I could solve this?

All replies gratefully recieved. Thanks in advance to anyone taking the time to read this post.

View 6 Replies View Related

New Record, Testing For

Jun 11, 2005

I need to disable a custom goto next record button. How do I find out if the current record is both the last and new or if a new record is possible?

Many thanks in advance,

Aidan

View 4 Replies View Related

Testing For Null

May 2, 2008

I know this is an easy one but have to ask...I am trying to test wether or not a Textbox in my form is Null or not...

Cant get it to work

Thoughts?


Code:If Text45 = "" Then MsgBox "45"Else MsgBox "THERE IS SOMETHING"End If

View 4 Replies View Related

Core Testing Database

Sep 1, 2005

Hi,

I hope someone can help me. Thanks ahead for taking the time to read through my post.

I am new to Access (I know the basics,) and will ask my question by hand of describing what I want to do with my database.

I work as a laboratory technician, where I need to test UTP cores (cores are what's called one of the 8 cables inside a UTP/Network cable.) I want to create a database where I can store these test results.

To make it easier to envision my database, I'll explain a bit about the actual testing. Cores are grouped together, and tested, according to batches. There are 40 cores in a batch. Each core has a unique job number. Further, the cores are divided into 8 different colors (Green, W/Green, Orange, W/Orange, Brown, W/Brown, Blue, W/Blue.)

A standard test procedure is done on EACH core: dimensions on the insulation on a X and Y axis; dimensions on the copper on a X and Y axis; a test to determine if the copper sits centre. There are thus 5 values I want to record.

My problem is: I want all 40 cores, each with their 5 values, on one form. I want to save this as one batch, or one record. How would I go about doing this? . It’s a bit more complex than your standard table-query-form-report database.


As I said, I am acquainted with the basics of Access. I can do tables, queries, forms and reports.

Thanks ahead.

View 3 Replies View Related

Testing For Null Fails

Oct 19, 2004

I have a table where some of the values of MyField are null.

I am creating a function that depends on the value of Myfield which I pass to a variable varMyField and am testing it with If IsNull(varMyVariable) but it errors. Have tried setting the variable as a variant but no difference.

Function Test(varMyField as variant)

If isnull(varMyField) then
Dosomething,
Else
Dosomething Else
End if

End function

Any suggestions please?

View 3 Replies View Related

Tables :: AutoNum While Testing

Feb 6, 2013

I created a table and a form. One of my tables fields is AutoNum. Each time I test the form layout, the AutoNum field increase and yet I am only testing at this stage!How can I bring back this field to zero? Where is my data stored (extension)?

View 1 Replies View Related

General :: Testing Folder For A Value

Aug 1, 2013

This code below works, but alot of what it does is unnecessary. I have a directory structure named 1000-2000, 2001-3000, 3001 - 4000 etc and within that is the individual folders 1000, 1001, 1002 etc

How do I test to search top level folder thats no larger than correctNum to then test the subfolder for correctNum? I've looked at instr and a few other funtions, but can't find a solution. Below is what I have now, it works but I know it searches everything and that's not correct

Dim filesys
Dim Subdir
Dim folder
Set filesys = CreateObject("Scripting.FileSystemObject")
Dim oDir
Dim bDir
CorrectNum = Serial.Value

[Code] ....

View 3 Replies View Related

Logic Testing For Incremental Numbers

Jan 7, 2005

I need some help with code. I can do this in Excel, but I am not sure how to do it in Access.

Here are the fields:

PoundsPerBox
PoundsPerOrder
BoxesToOrder

Here is the scenario: If a customer orders custom paint for their equipment, we need to total how many pounds of Powder Coat paint it takes to paint all the units (PoundsPerOrder). When we order this from the vendor we have to order it by the box which is measured in pounds. In this example, the vendor will sell us a box of white Poweder Coat paint in increments of 55 pounds. (55, 110, 165,...)

Verbally, the logic reads like this: If PoundsPerOrder is less than or equal to PoundsPerBox, then BoxesToOrder equals 1. This logic needs to be tested for each increment value (indefinately) of PoundsPerBox.

Am I making sense? How do I accomplish this in Access? And, as a side note, I need to capture and store this value in a table for future reference.

View 7 Replies View Related

Displaying Data - Whle Testing -

Oct 18, 2006

I know this is really silly.
How do I display data that I am working with in a report? I want to do the equivalent of alert or response.write. I am using msgbox, but it's getting old. What is the syntax for just displaying it ? Can I do that on a form? I tried using document.write, but it didnt like it. thanks-

View 1 Replies View Related

Modules & VBA :: Testing For Out Of Context Errors

Apr 9, 2014

I have quite a simple function. I am calling it in a query (through the Build window) like this:

Code : AbsMag: getAbsoluteMagnitude([Tbl]![m],[Tbl]![Distance])

When the input value for m is empty/Null, the response returned in the query is #Error. Problem is, any way I try to test for this in the function, it still returns #Error.The Watch for m reads "<Out of Context>" for these errors. Anyway to test/trap for this within the function itself?

Code:
Public Function getAbsoluteMagnitude(m As Double, d As Double, Optional dUnit As String = "Mpc") As Double
Dim absoluteMag As Double
' IsError(m) returns False
' IsNull(m) returns False
' IsEmpty(m) returns False

[code]...

View 3 Replies View Related

Modules & VBA :: Testing Combo Box Null Value

Sep 22, 2013

Windows vista
Access 2007

I can't seem to figure out how to test a combo box null value.I try:

Code:
If IsNull(Me.cboManufacturer) Then
MsgBox ("Please select category")
Else
DoCmd.OpenReport "rptItemCategory", acViewPreview
End If

This works if the combo box IS NOT NULL, but if null it gives me:

PHP Code:

Run-time error '3071': This expression is typed incorrectly, or it is too complex to be evaluated. 
For example, a numeric expression may contain too many complicated elements. 
Try simplifying the expression by assigning parts of the expression to variables. 

I then tried:

Code:
If IsNull(Me.cboManufacturer.Column(0)) Then
MsgBox ("Please select category")
Else
DoCmd.OpenReport "rptItemCategory", acViewPreview
End If

This works if the combo box IS NULL but if i've made a selection, it still gives me the message box as if I've selected nothing....

View 1 Replies View Related

General :: Testing Value Of Multiple Fields

Apr 6, 2014

I actually have about 13 separate fields in a table I'm trying to summarize in a single report field. Each field corresponds to a particular action taken. If the action was taken the field value is 1, if the action was NOT taken the field value is 0. The report needs to contain a single field that lists all actions taken. I tried doing this with an If statement formula on the report, but it does not work.

=(IIf([ACTION_VQ_SCAN]=1,"VQ Scan")) And (IIf([ACTION_OTHER]=1,[ACTION_OTHER_SPEC])) And (IIf([ACTION_CULTURE]=1,"Culture(s)")) And (IIf([ACTION_DRUG_THERAPY]=1,"Drug Theraphy"))........ and so on

It looks like it expects all if statements to be true, thus the formula does not return anything. Usually only 1 or 2 actions are actually taken, but I need to account for the possibility of any and all combination of actions.

View 3 Replies View Related

General :: Saving PDF - Testing To See If Directory Exists

May 31, 2013

I'm starting to automatically save PDF copies of certain reports in predetermined locations. I need to copy a file to a particular directory (based upon various criteria), but if the directory does not exist, I want to create the directory on the fly first. Otherwise I will just proceed with the copy.

I'm sure there is a DOS command to do this, but I can't find it.

View 5 Replies View Related

Beta-testing A Database While Making Improvements?

Jul 23, 2015

I need to start using the database I've created (desktop database). However, I don't want my current version to be the final version.

Should I create another file to work in and use the old version for data entry? When I am ready to start using my new version, is it easy enough to transfer all the data from the old?

View 3 Replies View Related

Emptying A Database Aftre Completeing And Testing The Application

Feb 16, 2007

what is the best way to do it without harming anything.

is it also possible to reset autonumbers

thanks

View 3 Replies View Related

Modules & VBA :: Testing A Field In Table For Null Within IF Statement

Aug 30, 2013

I have a form with two list boxes on it: listAllBANANA and listActiveBANANA

The listboxes are populated from tblBANANA. Active is defined by the tblBANANA field "ResponseDate" being Null.

Also on the form is a CloseBANANA command button. When pressed with no selection, it opens frmCloseBANANA to the first record. If a BANANA is selected in listActiveBANANA, the form opens to the selected record.

Now comes the tricky part: if a BANANA is selected in listAllBANANA, I first need to verify they have an Active BANANA selected, before opening the form. I've poked and tested and searched and cut and pasted my little fingers off with no joy. What I've deduced is that I'm either messing up the syntax of the DLookup or I'm incorrectly referencing the selected record. There's also the third option that I'm going about this in entirely the wrong way.

All other code below works. If I delete or comment out the line in red, I have no issues other than I may open up a blank form because I'm trying to close a BANANA that is already closed.

Code:
'If a BANANA is selected in Active BANANA or All BANANA, open Close BANANA to that record. If not, open form to most recent record
Private Sub cmdCloseBANANA_Click()
If Not IsNull(Forms!frmGUI!listActiveBANANA) Then

[Code] .....

View 8 Replies View Related

How To Reset Count Of Auto Number Fields After Testing

Dec 12, 2012

I would like to know, how do i reset the count of my auto number fields after testing? is it also possible to specify which number the auto number should start counting from?

View 3 Replies View Related

Forms :: Refresh Pivot Chart In Subform After Changing The SQL Of The Subform's Query?

Sep 16, 2014

I have a form, a couple of comboboxes and text boxes on it. When these are filled out, the SQL of a query is changed using these parameters.

There are three subforms on the form, all pivot charts, all based on the query being changed.

The goal would be to update all three according to the user-given parameters.

Right now the subforms only update if I close and open the form, which is probably not the best solution, since it's too slow.

I've also tried to requery and refresh them, with no result.

Then I tried to overwrite the recordsource of the subforms with the same text that was originally there. This got them to refresh their data, but then all of the charts disappeared and had to be built again, so this is a no go too.

View 7 Replies View Related







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