General :: Zero Value Is Not Correct?
Sep 2, 2014 I have a form that should give me all values below " 0" but I am getting zero
but when I click on that value I see this
-1.52587890625E-05
I have a form that should give me all values below " 0" but I am getting zero
but when I click on that value I see this
-1.52587890625E-05
The code I have is.
Code:
Private Sub Command26_Click()
If Forms![test site]![prp test].Form.[A Right Answer] = -1 Then
Forms![test site]![number correct] = Forms![test site]![number correct] + 1
End If
DoCmd.FindNext
End Sub
Then when clicked it checks a yes/no box to see if "A right Answer" is the correct yes. Then it should pop to the main form and take the number correct cell and add one to it. I am trying to get the record to go to the next record inside the sub-form but docmd.findnext seems to be wrong too.
I have a form which contains fields from my main table and also has a subform containing a query based on a filtered list of my main table.
I have a combobox on the form to select a name and pass it to the query to filter on.
The list of names is in a table called tblnames which has 2 fields, name and ID. I have linked the ID field on this table to a field called nameid on my main table which is a numeric field (and that allows be to select a name from a list when I enter data into my main table.
The xox is unbound, control source empty and row source set to tblname.
The combobox is only showing a list of numbers (I assume they are the id field from tblname). Yesterday I had the list of names showing and I checked a backup and the only difference I can see is the row source property refers to the name field in tblname but I don't know how I got it there. When I click on the list box for row source I only get offered a list of my objects.
What I'm looking to do is calculate the success rate (%) of compliance rates with Quality Control paperwork. Essentially, each record has 12 "check box" fields representing the different QC sheets that are submitted each day.
QCflavourChange
QCfillerOperator
QCblowMoulding
QCtorqueTest
QCnetContents
QClabeller
QCpacker
QCpalletiser
RMpreform
RMclosure
RMlabel
RMcarton
I have been able to find the code for counting the success rate of a specific type of QC sheet across multiple days worth of testing, eg:
=Sum(IIf([RMpreform]=True,1,0))])
But I have been unable to determine how I can count the total of all the successful fields listed above, across a single record.
I had a badly corrupted form in a front end DB. Compact/Repair didn't work. Importing everything into a new DB didn't work .... the db crashed access.
I imported everything except the dud form into a new db and everything was fine. I copied all the fields and controls into a new form.
When it came to copying the VBA, I did it one control/procedure at a time (from the Property Sheet) as I though it was safer.
Was I being over-cautious? Could I have safely copied/pasted all the code in one go ?
I am trying to get the message Request added to show up when the new record command works.
The message "add button error" show if there are any errors, rather than just doing nothing and stopping.
However when it works I get both, I know I doing something very simple very wrong.
Private Sub bAddRecord_Click()
On Error GoTo errorhandler
RunCommand acCmdRecordsGoToNew
MsgBox "Request added "
On Error GoTo 0
errorhandler:
MsgBox "add button error"
End Sub
I have a listbox on a form that looks up a table to to allow me to pick a stock location. The table only has 2 colums in it, the Primary Key Field (ID) and the Store location. When using this in a a form instead of getting the Stores Location, all I get is the ID. I have tried changing the Bound Volumn Value and the Column Count Fields, however no change.
View 2 Replies View RelatedUsing ms access 2010, I created a table called all items contains the ID, item name, item code, item price.
Second table I created called orders, contains item1,Q1=quantity,Tot1=calculated field.
Then a form to fill the orders table with a combo box for Q1 (gets the value from a table called numbers), second combo box for item1 (gets the value item code and item price from the table all items), and a text box to calculate the total of the Q1-item1(item price) All working perfect except the combo box for item1 ends up displaying a different item code that's only if the items were at the same price, for example, I choose latte from the combo box gives me correct item price but the code is cappuccino, only happening with items with the same price.
If I set the property of the combo box Bound Column to 1, I get correct item code but calculation error, Bound Column to 2, I get correct calculations but wrong item code. how to get the combo box to display the correct item code?
I have a vba code export a error message if the current date of a file is not correct.. I have tested the code it worked to send a error message to a error.txt file but he it doesn't look to the modified date
So instead of:
file1.txt (13-02-14)
Then
Send error message ("file not updated") to: Error.txt
IF NOT
no action requeried
This code does the following :
file1.txt (Modified date: 13-02-14)
Then
Send error message ("file not updated") to: Error.txt
file2.txt (Modified date: 14-02-14)
Then
Send error message ("file not updated") to: Error.txt
Code:
Sub CheckD()
Dim FSO As Object: Set FSO = CreateObject("Scripting.FileSystemObject")
Dim objFile As Object: Set objFile = FSO.GetFile("C:Users
ameDocumentsShow5621.txt")
If objFile.DateLastModified <> Date - 1 Then
[Code] .....
So also if it is the current date he send the error message to the error.txt file, it could be possible that i did something wrong.
In a query I would like to extract the last ten years. This is what the data looks like:12/13 (Data type = text)(Short for 2012/2013 which actually represents 7/1/2012 to 6/30/2013.)
I am able to extract the "12" and turn it into the general number 2012 using: ("20" & Left([TAXYR],2))*1..But how can I convert that to the data type-date so I can include those records in the past ten years from todays date? I was trying to use DateAdd but I think the problem is the data type and where converting to date gives me "1905" or "9/##/1905." I get why it does that, but is there a workaround? Maybe adding 39,785 days?? (2014-1905)*365
i have created a login form that opens the home page when the correct credentials are entered. i would like to add an 'access level' so that when logging in the database checks the access level and opens the appropriate home page. (i.e. level one has selected options.. level three has admin)
i just need a code that checks what the users level is and then open home lvl#
(i.e. user level 1 - open 'home lvl1', user level 2 - open 'home lvl2 etc)...
Hi everyone,
I am trying to build a little shopping cart. I think my major problem is the relationships. I can't seem to get them right.
My major problem is adding items to the shoping cart (basket).
I guess 1 item can go in many baskets and a basket can hold many items. Make sense?
so i have my tblItem & tblBasket, and then I made another table called tblConnectBasketItem, which holds the itemid & basketid.
In any rate, this is where I got confused.
If someone can look over my DB, and give me some pointers, that would be great and thankfull.
You can find my DB attached.
Thanks again,
Sass
I’m struggling to fix a database for my state agency. Here’s what the social workers need:
The agency holds several Foster Parent training sessions a year. Each session consists of 9 classes. We need to track ‘student’ attendance at each class. We also need to track class dates for each student.
The fly-in-the-ointment: ‘Student’ foster parents must attend the 9 classes, but they can fulfill this requirement over several sessions. They can take classes 1, 2 and 5 in Session 1, classes 3, 4, 7 in Session 2, and so on.
Here’s what I’ve created:
tblSessions
SessionID
SessionLocationkey ( to tblLocations; irrelevant to this post)
SessionStartDate
SessionName
tblClasses
ClassID
SessionIDkey
ClassTopic
ClassDate
tblAttendance
ClassID
StudentID
tblStudents
StudentID
StudentFirstname
etc.
The Attendance table is the junction table for the many-to-many relationship between Students and Classes.
Is this the correct structure? Thanks in advance for any advice. And thanks to Pat Hartman, The Doc Man, and SJ McAbney for getting me this far with the advice I found in researching this topic.
Sean
tblFAR
FarNumID (PK)
FarNumber
FarTitle
tblFarParagraph
FarParaID (PK)
FarNumID (fk from tblFAR)
FarParaTitle
FarParaText
tblAC
ACNumID (PK)
ACNumber
ACTitle
tblACParagraph
ACParaID (PK)
ACNumID (fk from tblAC)
ACParaTitle
ACParaText
1.Each FAR contains Many FarParagraph 1 to Many
2.Each AC contains Many ACParagraph 1 to Many
3.Each FarRParagraph contains Many ACParagraph
AND
Each ACParagraph contains Many FarParagraph Many to Many
What I’m trying to do:
FAR
Chapter 1
Paragraph a – Relates to AC Chapter 4 paragraph a1
Paragraph b – Relates to AC Chapter 4 paragraph a
Paragraph c – Relates to AC chapter 6 paragraph b
AC
Chapter 4
Paragraph a – Relates to FAR Chapter 1 paragraph b
Paragraph a1 – Relates to FAR Chapter 1 paragraph a
Paragraph a2 – Relates to FAR Chapter 6 paragraph c
Paragraph b – Relates to FAR Chapter 8 paragraph d
I’m not sure if my design is correct for what I want.
BTW -- AN "AC" and "FAR" are just a type of document.
Thanks
Paul
Dear All
It may be a very dump question but I can't get my head around it.
I have a MainForm and then a subform Form1 on it.
There is a command button cmd1 on subform Form1. Now I want to access cmd1 through another command button cmd2 on a different form Form2. How would I design the statement?
I have tried the followings on OnClick event of cmd2 on Form2
Forms!MainForm.Form1.cmd1.visible = true
Forms!MainForm.cmd1.visible=true
Forms!Form1.cmd1.visible=true
Forms!MainForm.Subform.Form1.cmd1.visible=true
Nothing works. Any suggestions?
Thank you
:confused: :confused:
Hi guys,
Attached is a real simple database. What I want to be able to do is insert new payment details, and I have a couple of issues.
I have two clients and need to be able to select which client I want, select the payment details from the drop down list and enter in some appropriate amount.
Its been a while since I've created a db from scratch so this is obviously where I am having my difficulties. However I think I need to use a sub form.
How can I input the details as above, and how can I always get the combobox to default to the first entry in the list rather than defaulting to zero?
Thanks for the pointers.
End result query example:
Between #10/15/04" And #10/15/04# - 6
Or the date range of 10/10/04 through 10/15/04
This would be in a query under the Date field
What is the correct syntax? Please include
() and # signs where they need to be.
Thank you.
I have an order table and depending on the the product grp it needs to then be able to select the appropriate size scale table.
e.g.
I order suits, and select a size grade A ( there are 7 size grades ) I then then to enter the size scale for that product. I am not sure whether to create 7 differant tables with the different size grades and link that to the table, if so how do i get it select the correct table.
please help...
H
Selecting the correct table
--------------------------------------------------------------------------------
I have an order table and depending on the the product grp it needs to then be able to select the appropriate size scale table.
e.g.
I order suits, and select a size grade A ( there are 7 size grades ) I then then to enter the size scale for that product. I am not sure whether to create 7 differant tables with the different size grades and link that to the table, if so how do i get it select the correct table.
please help...
H
Hi all..
I have a simple database setup...
When I do a test query on the tblMain.. all I get are numbers.. How do I change the numbers to text?
Thanks again
R~
I wonder if any one can help with this one, shown below are 2 examples of strings in a field called PROCOM
Occurred: EnterMeterReadings; Reason: Reading greater than upper limit; Session: 0A52BE4293.worker1
MSPSubmitMeterReadings; Reason: CANNOT BILL LATER THAN 29/02/08, DATE AMENDED FROM 13/03/08
I ususally nest IIf statements to abbreviate these in another field (PROC), as PROC: IIf ([PROCOM] like Occurred: EnterMeterReadings; Reason: Reading greater than upper limitMRE-Upper limit",[PROCOM])
The problem I have is there now 30 permutations of the error and IIF can only nest 8 statements (and it looks very messy). I thought that Select Case would do the job but I cannot use
Select Case
Case Is Like "Occurred: EnterMeterReadings; Reason: Reading greater than upper limit*"
Hope someone can help with this one
Thanks in advance
Very simple question:
How do I make the results of a query which I am displaying in a combo box appear in order.
e.g. 1 then below that 2 then below 3 then below 4 etc
even though I may have entered the details in a different order. I've tried doing it order by ascending and decending but this doesn't work.
Many thanks
Paul.
This is what I'm trying to fit into the control box. Maybe there is a much better way to do it so suggestions are very welcome. I don't know if I can even use "!" in the IIF statement. And I think it's too long, so it's invalid.
What I'm trying to do is to check if all those fields are passing (or NOT failing). Then insert "Yes" or "No" into a textbox.
----------------------------------------------------------------
Code
----------------------------------------------------------------
IIF(blackStartPlans!=”fail” and operatorTraining!=”fail” and telemetryAvailable!=”fail” and backupControlCenter!=”fail” and vegetationManagement!=”fail” and capacityEmergencies!=”fail” and cat_A_contingency!=”fail” and cat_B_contingency!=”fail” and cat_C_contingency!=”fail” and cat_D_contingency!=”fail” and electricityFacRating!=”fail” and relayMaintenance!=”fail” and UFLS!=”fail” and UVLS!=”fail” and Other!=”fail”, “Yes”, “No”)
first of all sorry to my poor English
I have subform of inventry Transaction there are field productId, UnitsSale, SalePrice
I am using combo box on productId and want to calculate When i change productId (Stock in hand to show on msgbox) for the productId which i choosen from combo box
if any one know about it please help
Baig
Sorry...attached the wrong file. Here it is again.
View 4 Replies View RelatedOK, my database is also complete, thanks to the help of this forum!!!
My next question is:
I have a switchboard that has a button for my data entry form. The lady that will use this form will, of course, enter all her records using the form into the database. Because of what she does, she will have to go back to records on a daily basis to make corrections to individual records. I would like a way to put a command button on my switchboard that will say something like "Correct Records". She will hit this button and it will ask her for the medical record number she wants to correct and then will take her to that record to correct.
Is there a way to do this or is there a better way? Currently I have a button that will ask for a day range and then will bring up a query of those records for her to correct but I would really like to be able to somehow bring up the individual record, by medical records number, for her to correct instead of going through a long list of records that were input on a single day. Thanks so much for all your help getting this thing up and running!!!!