Subform Correct Answer Adds To Number Correct In Main Form

Mar 2, 2012

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.

View Replies


ADVERTISEMENT

Subform Not Displaying Correct Records From Main Form

Feb 23, 2005

Hello. The problem I am having is related to two tables. I have a table called Void and a table called Panel. A panel can have multiple voids and a void is assigned to only panel (one-to-many). In the Panel table, I set an autoincrementing number(SprayPanelId) for the pK. In the Void table, I set an autoincrementing number (VoidId) for the pk. I place the SprayPanelId into the Void table as a foreign key (same name in the void table). The problem I have is in my forms. I created a Panel form with a button to open a subform for data entry on the voids related to the panel in a new window. Data can be entered and is properly saved in the Void table. I open the Void table in a datasheet view under the table section and see it is properly there. I can run queries where Void.SprayPanelId = Panel.SprayPanelId and it returns the correct void with the correct Panel. The problem becomes when I open my void subform, it no longer displays that record associated with that panel. however, the record is there in my void table. Any thoughts? Do I need a filter perhaps, run any sql commands? Thanks in advance, Kevin

View 2 Replies View Related

MsgBox Closing Main Form Then The Correct Form?

Aug 25, 2005

Hi all,

I've added a message box to what is basically a standard simple to use access control, "closeForm", I'm a newbie working on learning access vb. I'm guessing my code if fudged. Any help is greatly appreciated.

Private Sub Close_Click()
On Error GoTo Err_Close_Click
Dim Answer As Integer
Answer = MsgBox("Press Ok to Close, Cancel to Continue.", vbOKCancel + vbQuestion, "Exit Data Entry?")
If vbOK Then DoCmd.Close

Exit_Close_Click:
Exit Sub

Err_Close_Click:
MsgBox Err.Description
Resume Exit_Close_Click

End Sub


Thanks to all in advance

View 5 Replies View Related

Correct Week Number Format In A Query

Jan 6, 2005

Wondering if anyone can advise...

The 1st/2nd Jan of this year were treated by most people as still being week 53 of 2004, and week commencing 3rd January being week 1 of 2005. In VB I have a formula to do this:

WeekNo = Format(Now(), "ww", vbMonday, vbFirstFourDays)

However my problem now is that I need to replicate this format in a Query within Access. The formula

WeekNo: Format(Date(),"ww")

treats 1st/2nd Jan as week 1, the 3rd as week 2 etc. Any idea how I can get it to treat 3rd Jan as week 1 instead?

There's a challenge for someone!! Help appreciated.

View 1 Replies View Related

Queries :: Correct Syntax / Expression For Log Of Number

Mar 23, 2013

Correct syntax/expression for log of a number. The number i am getting in Access is twice as big as the correct number i get in excell

View 3 Replies View Related

Modules & VBA :: Returning Correct Number Of Records

May 3, 2014

I am having trouble with the below returning the correct number of records, and can't see why.

I have one table, tblDevice, which has 4 columns, ID | DeviceRecNo | ExcludeFromCheck | StockLocationID

ID - Autonumber
DeviceRecNo - Number
ExcludeFromCheck - Number (1 = yes, 0 - No)
StockLocationID - Number

I have the following running as part of some code, but it is not returning the correct number of records, and I cant see why not. I have tried creating this in a query in Access itself, and copy the SQL into VBA and it still doesn't return the correct number records.

I have 4 records in there for testing, all with StockLocationID = 3, all with different DeviceRecNo, and two each of ExcludeFromCheck, 2x0 and 2x1

Code:
Public Function test()
Dim db As dao.Database
Dim rs1 As dao.Recordset
Set db = CurrentDb
Set rs1 = db.OpenRecordset("SELECT DeviceRecNo FROM tblDevice WHERE StockLocationID = 3 AND ExcludeFromCheck = 'No'")
Debug.Print rs1.RecordCount
End Function

View 3 Replies View Related

Tables :: Subform Not Showing Correct Records

Jul 26, 2013

Table Info:

EmpProfile: EmpID (Primery Key), EmpFirstName, EmpLastName, Emptitle, EmpPhoneNumber

EmpTimes: EmpID (1 to Many relationship with EmpID primery key), Timein, Break, TimeOut, Totalhours

Query Name:

Selects the table from EmpTimes
Calculates the total hours worked for an empid, on a given day. It produces the total hours as "CalcTime"

Form Info:

1st Form Name: MainForm
Text name to enter empID : Txtempid (unbound)
Record Source: EmpProfile

2nd form name: SFTimeSheet
This is a subform within main form
Record Source: QryTime
Child and master fields are linked using : EmpID

Expecting Result:

When enter empid on the MainForm, in txtempid
subform should retrieve all entries for that empid

Getting result:

regardless what empid entered in txtempid, subform shows only the 1st record available in EmpTimes.

View 3 Replies View Related

Convert General Number To Correct Year Date Data Type

Jan 10, 2014

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

View 4 Replies View Related

Display Form Correct With Different Resolutions

May 9, 2006

One of my probs with access is changing the form when a different resolution is being set.
Is there a visual basic module or something else to display the form properly dependent of the selected resolution?

View 1 Replies View Related

Correct Picture To Each Record In Continuous Form

Jun 15, 2006

Hi Good-Morning (its morning here in Jamaica) (Whatever time of day it is where ever it is that you great minds are in this beautiful world we live)...

I created a form and used an image control with a filepathfield that is stored in my table,... that works well as far as displaying the correct picture for each record...

I now want to create a Continuous Form with the correct image displayed for each row or eachrecord///

The problem is all of the images are displaying the same picture, but i want them to show their correct pictures... I used an on current event which i guess is why tha is happening cause all the pictures change when different record selectors are clicked...

Please advise how i could get around this...
I looked at the Northwind database, but that database uses an OLE object, I would like to use the filePath field that i have in my database...

Any Ideas? Thanks in Advance

View 2 Replies View Related

Combo Box To Select Correct Record On FORM

Dec 1, 2007

I have database of roughly 15000 records. The records have a unique number and the majority of searches etc work OK. The problem is with a form used to display record details with various sub forms embedded on the form.
Scrolling through displays the correct details.
Trying to use a combo box to determine the record selected does not work correctly.
The combo box is made up of 4 columns of "NAME", "COUNTRY", "ROLE" and "UNIQUE NUMBER"
Typing in the combo box auto fills in the NAME until the correct one is found. If the name is unique it opens on the form correctly. But if the name is not unique it does not always open the correct record.
Is there any way of being able to use the NAME to search through the combo box entries but use their unique number to determine the record selected.
A further problem arises as there are apostrophes in the NAME as well

View 3 Replies View Related

Modules & VBA :: Using If To Load Correct Form On DB Open

Sep 22, 2014

I am trying to load a form based on an if statement. I think my issue is that I have the DB set to Display form "frmSplash" on open. I have tried the following (frmSplash form load event) but it continues past the frmMenu and stops at the frmSplash. I want to open the DB and look to see if it is registered and if yes then open frmMenu. There is 1 record in tblRegistration so it should open to frmMenu. I checked and it is seeing the 1 record.

Code:
Private Sub Form_Load()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM [tblRegistration]")
If rs.RecordCount > 0 Then

[code]...

Does the display form on open override all? how to achieve to goal?

View 1 Replies View Related

Forms :: Form Not Printing Correct Record?

Nov 7, 2014

After data is entered and exit and print is selected, it doesnt print last record in the table

View 7 Replies View Related

Forms :: Have To Open Form Twice To Get To Correct Record

Sep 4, 2014

In the following code to add an article to a purchase order line table and then open the form on the purchase order in question , I had to open the window "frmPurchase" twice in succession. If I omit the first docmd.openform statement, the form would open at the first record in the table, not the one defined in the where clause "PUOpen and PUCompID = " & Me.lstCompany.

I had noticed previously that, when the form "frmPurchase" was already open, Access went to the correct record, and not if the calling program had to open the window, which is why I came up with the idea of replicating this behavior in the code.

With rstC
.FindLast "PULineNB <> 0 AND PuLineHeadingID = " & rstB!PUID
If Not .NoMatch Then
linenb = rstC!PULineNb
Else
linenb = 0

[Code] ...

Is this normal behavior, and if not, how can I improve the code?

View 14 Replies View Related

General :: Listbox Not Showing Correct Column On A Form

Dec 17, 2012

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 Related

Tables :: How To Get Information Inputted On Form To Store In Correct Table

Mar 4, 2014

I'm having some trouble getting my information that I input on my form to store in my correct table. I will attach my DB so you can take a look at what I have thus far.

Here is what I am wanting to do:

I have TblEmployee, TblEquipment and TblJunction and FrmTracking and FrmUpdate

I input the bulk of my information thru FrmTracking, my trouble is I can not seem to get the information that I input in my FrmTracking to store in the correct table. I can get the information to store in TblEmployee, however the information that I want to be stored in TblEquipment will not store in there.

View 14 Replies View Related

Reports :: Booking Sequence - Report Not Generating From Correct Form?

Oct 7, 2013

I have a booking sequence. Sales representatives take an order on a booking form and then then click a button to draw up the related report. The form is showing all Booking forms, not the specific one just taken.Do I need an OpenArgs statement? I've tried that but can't seem to get it to work.

View 10 Replies View Related

Modules & VBA :: SQL Where Clause - Open Form To Correct Work Order?

Aug 25, 2014

Windows 7
Access 2013

I've been trying to work up a where clause that is generated by a button click event on a report. The workflow that i'm trying to obtain is as follows:

1) A report is run to determine the remaining work orders that need to be processed.
2) A button that is placed on that report is to be clicked, taking the user to the form associated with that work order, so it can be processed.

What i've been able to do so far is capture the unique ID for the work order and then print that in a message box. I can then open the form.

What i haven't been able to accomplish thus far is to open the form to the correct work order.

Things I've tried : I started trying to use the macro with the search for record option and using the where clause. Not successful. I am a little more comfortable in using vba so i switched to that pretty quickly.

Code:
Private Sub btnJobEntry_Click()
'GOAL: open the work order form to the correct entry
'METHOD: store the uniqueID to a variable, then use that in the open command's where clause
Dim strJobID As String
'store the unique ID in the variable

[Code] ....

I've put the strJobID variable in both the filter and where clause sections of the DoCmd but it just opens the form to the first entry. I'm fairly confident i'm not applying the filter/where clause correctly by using the incorrect syntax.

View 3 Replies View Related

Forms :: Must Click Toggle Filter For Form To Show Correct Data?

Jul 26, 2013

I have a navigation form with a combo box. The combo box has a running list of manifest numbers. I select a manifest number, then click a button that brings up a new form with data related to the selected manifest.

However, I have to click and unclick the 'Toggle Filter' button on the new form to show the correct data each time I open the form.

View 2 Replies View Related

General :: Login Form To Open Home Page When Correct Credentials Entered

Jun 16, 2013

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)...

View 5 Replies View Related

Correct Code Command To Keep Form Open After Selecting Close Control Box Button?

Oct 13, 2015

I am at my Login Screen, I want it to return to the Login Screen if you select "NO" and Close the DB if "YES"

Here is my current code:

Private Sub Form_Close()
If MsgBox("Would you like to EXIT the Database?", vbYesNo, "Quiting Database") = vbYes Then
Application.Quit
Else
???
End If
End Sub

View 5 Replies View Related

Not Sure I Have My Relationships Correct...

Nov 10, 2005

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

View 2 Replies View Related

Many-to-many Structure Correct?

Jun 11, 2005

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

View 12 Replies View Related

Is The Design Correct For What I Want?

Apr 26, 2006

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

View 1 Replies View Related

Please Correct This Statement

Mar 31, 2005

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:

View 3 Replies View Related

Getting Correct Output

Jun 29, 2005

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.

View 3 Replies View Related







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