Trying To Make A Program Failing

Feb 17, 2007

well i am trying to make a very simple program that would help me learn the capitals of each country. yes it is a weird thing to do but i just it might help.
anyway i started doing it using access and made a table with three columns primary key number, country and capital.
I started making a form and im tryin to make it so the program would randomly pick a country and i would have to choose from a list box the capital and i would have a command button which when i click will tell me if i am right or not and if i am not then it would say the right capital.
How should i do this?
p.s ino the basics of using the code builder
help much appreciated.

View Replies


ADVERTISEMENT

Need Help With Failing Iif Function

Feb 5, 2006

In my query I have the folowing expression:

Currency: Iif([Exch]="1";"Szt";"Eur") - if the exchange rate is 1 then the currency is Zlotty if different from 1 then it's Euro

When I run the query it returns "#Error" ?

Anyone have an idea to fix this?

View 2 Replies View Related

SQL Failing To Pick Up List Box Value

Feb 26, 2008

Hi all

I have a form which is used for entering holiday requests.

It has fields such as name, type of holiday, date from and date to but it also has a list box value. This list box contains the number of days between the date from and date to and exludes weekends and bankholidays using data from a table. The data from the form is inserted into a table using an sql string when the submit button is pressed. The problem I have is that the sql does not pick up the number of days from the list box unless I click on the list box before I click on submit. It is almost as if the value is in the list box but it is simply not recognised by the sql unless I select the list box using the mouse. I have tried to select the list box using code when the submit button is pressed but to no avail. Does anyone have any ideas how I can over come this or perhaps how to physically select the list box so it is highlighted when the submit button is pressed??

Thanks all

Gareth

View 1 Replies View Related

Updating Query With IN STATEMENT Failing.

Dec 2, 2005

This is driving me absolutely insane, can anyone find why this won't work?

UPDATE tbl_PrivateMessages SET tbl_PrivateMessages.RecipientStatus = 1
WHERE tbl_PrivateMessages.MessageID IN ([Enter MessageIDs]);

I've tried updating it through ASP with the following:

Execute UPDATE_INBOX_MSG_STATUS 0,26,25

And also just tried running the query from access itself using 25,26 as IDs.

Neither of those seem to work...please advise. Also, I don't even get an error message as to why it didn't update.

TABLE STRUCTURE
MessageID - AutoNumber
MessageUserID - Number
MessageSubject - Text
MessageContent - Memo
MessageAuthor - Number
MessageDate - Date/Time
AuthorStatus - Number
RecipientStatus - Number

Many thanks

Steve Johnson

View 4 Replies View Related

Multiple INSERTs At Speed Failing?

Aug 29, 2007

I am trying to issue multiple INSERT statements in a row - but it seems that only the first succeeds. If I put a 1-second delay between attempts, suddenly they all succeed (so I know the statements themselves are all valid, it's not a data issue).

These are all being issued in a loop from the same thread, so as far as I can see unless the data is being inserted asynchronously, I can't see any problem. If it is being done asynchronously - how are we supposed to know one INSERT succeeded and thus we can issue the next one?

Anyone have any idea why this might happen? I don't want to leave 'magic delays' in the code!

View 2 Replies View Related

Referential Integrity Check Failing, And Can't Figure Out Why

Dec 8, 2006

Hello I'm helping a friend with an access project and the Referential Integrity check is failing for some reason unknown to me. I recreated the entire database from scratch and added all relationships before adding any data and then added in the data. The tables giving me problems are the following:

Orders Table:
OrderID - Primary Key Autonumber, Format:1000, Indexed: Yes(No Dupes)
CustID - Number, foreign key to a customers table, 1-many relationship
SalesID - Number, foreign key to a sales table, 1-many relationship
ShippingID - Number, foreign key to a shipping table, 1-many relationship
3 different date fields and a price field

This table is filled with data.

Order Details Table:
ItemID - Primary Key Autonumber, Indexed: Yes(no dupes)
OrderID - Number, Dec. Places: Auto, Required: Yes, Indexed: Yes(dupes OK)
RingID - foreign key to rings table, 1-many relationship
StoneID - foreign key to gemstones table, 1-many relationship
Ring Size - number

There is no data in the order details table.

The Orders to Order Details is a 1 to Many relationship with ref integrity and cascading updates and deletes enforced.

When I try to manually type in a record I get the "You cannot add or change a record because a related record is required in table 'Orders'" even though I added a lookup list box listing all the OrderIDs from the Order table. I know I'm typing in a valid OrderID number, but it's not taking it and throwing this error.

Any ideas why? You advice is greatly appriciated!

Thank you.

View 4 Replies View Related

Requery Failing To Add New Record To Form List

Nov 29, 2004

Hi,

I have inherited a buggy database thas has a simple piece of code that won't behave the way I think it should!
The code should add a new record and have that new record appear on the list form (where the button On_Click event is called) making it available for user edditing. In 99% of cases though, the blank new record does not appear. The record is getting created, as i can see it in the table and have added a watch to the RecordCount property, it just doesn't display automatically. The existing workaround for users is to click a second button that invokes a simple one line function sub that performs only a Me.Requery. The user presses that up to two or three times before the new blank record finally appears.

One solution I read about, but hesitated in trying due to the unprofessional 'flash' that occurs, was to close the form and the re-open it...anyone experienced this or can comeup with a neat workaround?

The code

Private Sub CmdAddRule_Click()

Dim db As AO.Database, intnextseq As Integer
Dim TestThis As String
Set db = CurrentDb()
Dim rstDao As DAO.Recordset
Set rstDao = db.OpenRecordset("select * from stblAllocRules order by intRUSequence desc;", dbOpenDynaset)
If rstDao.RecordCount > 0 Then
intnextseq = rstDao!intRUSequence + 1
Else
intnextseq = 1
End If
With rstDao
.AddNew
!AutRU_id = 0
!intRUSequence = intnextseq
!bytAppendBack = 1
!bytUpdateBack = 0
!bytDeleteBack = 0
.Update
.Close
End With

Set rstDao = Nothing
Set db = Nothing

Me.Requery
Me.Repaint 'I have used this staement in addition to and instead of the Me.Requery to no effect
Me.Recordsource = Me.RecordSource 'I have used this statement also in addition to the above to and in isolation, to no effect.
End Sub

View 2 Replies View Related

Network FE/BE Issue? - Complex Form/Subform Failing To Load

Dec 7, 2006

Hello all,

I have created a FE/BE database which is operating on a network. There is one FE for each person (approx 150) all accessing 1 BE. There are at most, maybe 10 people using it at once. The database has been working well for about 2 months.

My problem is not with data corruption (touch-wood!), but with a complex form.

The Form is split into a Header/Footer, with a Detail section containing a subform. The main form filters records that appear on the subform. The subform is continous, with several conditional formatting cells per record.

Most of the time it works fine, but occasionally, the main form opens, but the subform fails to load/open. All I see is a white page with the main form header displaying correctly along the top 1/3rd of the screen. No error message is displayed. If I print the page using a Report (The subform and Report use the same query) the page prints perfectly with all records showing.

I have seen this problem on several different workstations, only to try again later to see it working (having closed the db, logging off then back on again)

I am at a loss with this one. Is it a problem with Access or the network? I am unable to find anything similar to this problem on the forum. Can anyone shed any light on it?

View 2 Replies View Related

Queries :: Failing To Filter By Criteria After Return Values From A Function?

May 15, 2013

I have two date fields in a table. I need to find the days between these dates and, if its greater than 7 days, I want to display the record in a report, so far, I have found a hand function that allows me to enter two dates and it returns a long data value representing the number of days in between the two dates. (google "I've developed the following code to count the business days between 2 dates." and its the second one that starts as SOLVED I made no mods to it as it does what i need it to do.

So, i added this to its own module within the data base for use within a query. My test query basically displays the unique ID, the start date and the end date and then displays the values returned from the function. here is the SQL:

SELECT [Main Table].[Unique ID], [Main Table].[Start date], [Main Table].[End Date], (Business_Days_Between([End Date],[Start date])) AS [Days between]
FROM [Main Table]
WHERE ((([Main Table].[Start date]) Is Not Null) AND (([Main Table].[End Date]) Is Not Null));

When ran, this Query works... However, when I enter a criteria like =2 or > 7, it says data type mismatch. I have even attempted the CInt() function to make sure its formated as int but i continue to get the same error.

View 11 Replies View Related

Reports :: Unbound Object Frame Failing To Display Linked Image At Correct Resolution

May 18, 2013

I am using an unbound object frame to display an .png image file which is set in vba.

The image is an excel chart saved as a .png

The problem I have however is that the image I save from Excel is great quality, and is pretty tack sharp, but when I display the same file in the unbound object frame in access, it is not nearly as sharp.

I am setting the picture property of the control as:

ubImageUserChart = "c: empmyChart.png"

It displays alright, but is just a bit fuzzy - still quite legible, but it is a complex graph with a lot going on - has regressions and formulas etc on the graph, and they need to be very clear.

BTW - the unbound frame is the same size as the Excel chart which gets saved as a .png file. If I tile the images (Access unbound frame and original file in picassa preview) side by side - they are identical - size, orientation etc.

It is not practical for me to try and do the chart natively in access as it is way to complex. I am using access vba to drive an excel session to do all the statistical yack work and chart rendering, then displaying a png image of the resulting chart in an unbound object frame in access.

View 7 Replies View Related

Reports :: Sub-reports With Pictures - Images Failing To Load

Dec 11, 2013

I have a Report containing a sub-report which holds the pictures. Typically there are 3-4 pictures per A4 page and 2-3 pages, so not millions, but for some reason whenever I load I get between 1-3 pictures a page and the rest show as blank. I can repeatedly reload time after time and get a seemingly random number of successful images.

The original images are on a network drive (but connectivity is good). They are high quality images but the load time isn't that bad (Is there a 'normal' load time for these things?) I wonder if it's just timing out after the first X pictures..

View 5 Replies View Related

Best DB Program

Jun 24, 2007

I am trying to design a database for the company i work for, and I am wondering what is the best program to use.

My database will be shared on a network, and many different users will be using it at once. Also, I need this database to allow vpn connections so that certain people can access the db from outside of the office. I am not sure if db programs would deny a vpn user access, it might not make a difference how people are accessing info, but i think its worhtwile to mention that.

I appreciate your help, even though you opinions may be just a little biased. but thanks none-the-less.

View 14 Replies View Related

Better Program Structure

Dec 16, 2005

Hi all!

I have created a database with auto-archiving features. I have "working tables" that are populated when the product is moved to the correct process, in this case when it reaches the test department. When the product is moved out of the relevant process, the database runs several queries which archive the relevant data and deletes the records from the working table.

There are two working tables in the test department, one for test failures and one for rework activities. The question at hand is WHEN should I populate the working table for rework activities:

Option 1: Populate the table when the product moves to the relevant process. This will create and delete thousands of records from the working table every day. Using this method will cause my table to bloat to 50,000+ records that are constantly updated, appended, and deleted.

Option 2: Populate the table when (and IF) the product fails a test. This will keep the table to a much smaller size (around 2500 records) but requires the database to run several queries in the middle of the data entry process, significantly slowing my program.

So which is the faster/better process: Filtering a table of 50,000+ records or appending the working table when you need the data?

View 1 Replies View Related

Moving Within A Program

Jan 4, 2006

Hi,
I have a delimma and am not sure how to proceed. It falls under the "You want what? When?" category. Basically, I have created an Access program with several (13) related tables and numerous forms. This program mimics an interview we are using for research and has a lot of VBA coding behind it with quite a few skip patterns, value checking, etc. During the testing phase, I was asked to allow the user to be able to go back and check a response to any previous answer at any given point in time. I hear numerous clicks of people running away from this question. This one has me frustrated and not too happy. I am wondering if there is some way I can show a copy of any form and the data contained within it for the present ID? IF it is a copy then the data, I presume would be locked and the user would not be able to change it. Also, I would want to bring the user back to the point where they were prior to going backwards. Feel my pain yet? Of course as I ponder this I can envision that they are going to want to change a value, because maybe a respondent "changed their mind" about a previous question. But, I am sure they would not want to work their way back to where they were, but want to jump back (forward), all the while I need to insure that any skip patterns that may have changed due to a change in data are followed and if a question that was answered before is now skipped then that data needs to be cleaned. I am concerned that as I begin to meander through this issue that I will have "duplicate ID" issues because as I move backward, possibly through several forms and tables and then move forward again the DB will think I am adding two items rather than changing the one. I.e., it will think I have two identical IDs because it already has one from the original pass and as it moves forward and runs through the automated saves that the second pass would represent a duplicate ID, thus crashing the program.
I know this is a multi-pronged question, but I would like to hear some suggestions as to how others with more experience would handle this. I am grateful for your time in reading this and would be even more so for any responses.

Peace!

View 3 Replies View Related

Can I Program A Function Key?

Aug 24, 2006

I have a bunch of files where I have to copy one piece of data from a field and paste it into a different field on many records...in sort copy once, paste many times. Currently I use Ctrl C for copy and Ctrl V for paste. I'd write a query to do this for me, but not every record is going to recieve the data.

I'm getting tired of having to press Ctrl V on the appropriate records. Is there way to program a function key to do the Ctrl V thing? That way, I'd only have to press one key as opposed to pressing two keys.

Any help offered is truly appreciated. Thanks!!

View 4 Replies View Related

Can Someone Solve This Vba Program

Oct 10, 2006

Following program i have written in access. what it does is from the query i have created picks up the sizes of doors. calculates hit1 by qty then it needs to put the value into another table alongside the correct sizes. the problem im facing is how do i update the value into another table. heres the listing.

Option Compare Database
Option Explicit
Dim Db As Database
Dim Rs1 As Recordset
Dim Rs2 As Recordset
Dim lf, rh, drw1, drw2, drw3, drw4 As String
Dim q1, q2, q3, q4, q5, q6, qty As Integer
Dim hit1, hit2, hit3, hit4, hit5, hit6 As Integer



Private Sub Command70_Click()
Dim rs1fieldcount As Integer
Dim counter As Integer
''Assign a mdb
''+++++++++++++++
Set Db = CurrentDb
counter = 0
Set Rs1 = Db.OpenRecordset("custdoorsize")
Set Rs2 = Db.OpenRecordset("cusdoorsbase", dbOpenDynaset)

rs1fieldcount = Rs1.Fields.Count


If Rs2.RecordCount = 0 Then
MsgBox "No record found in query"

Else
this is where the value will come from
Do Until Rs2.EOF
If Rs2.Fields!left_door_size <> Empty Then
lf = Rs2.Fields!left_door_size
hit1 = 1
q1 = hit1 * Rs2.Fields!qty
End If

If Rs2.Fields!Right_door_size <> Empty Then
rh = Rs2.Fields!Right_door_size
hit2 = 1
q2 = hit2 * Rs2.Fields!qty
End If

If Rs2.Fields!draw1_size <> Empty Then
drw1 = Rs2.Fields!draw1_size
hit1 = 1
q3 = hit3 * Rs2.Fields!qty
End If

If Rs2.Fields!draw2_size <> Empty Then
drw2 = Rs2.Fields!draw2_size
hit4 = 1
q4 = hit4 * Rs2.Fields!qty
End If

If Rs2.Fields!draw3_size <> Empty Then
drw3 = Rs2.Fields!draw3_size
hit5 = 1
q5 = hit5 * Rs2.Fields!qty
End If

If Rs2.Fields!draw4_size <> Empty Then
drw4 = Rs2.Fields!draw4_size
hit6 = 1
q6 = hit6 * Rs2.Fields!qty
End If

Do While counter <> rs1fieldcount

This is where it finds the correct sizes where it will display the qty value

If Rs1.Fields(counter).Name = lf Then
Rs1.Edit
Rs1.Fields(counter).Value = q1

End If
If Rs1.Fields(counter).Name = rh Then
Rs1.Fields(counter).Value = q2
End If
If Rs1.Fields(counter).Name = drw1 Then
Rs1.Fields(counter).Value = q3
End If
If Rs1.Fields(counter).Name = drw2 Then
Rs1.Fields(counter).Value = q4
End If
If Rs1.Fields(counter).Name = drw3 Then
Rs1.Fields(counter).Value = q5
End If
If Rs1.Fields(counter).Name = drw4 Then
Rs1.Fields(counter).Value = q6
End If
counter = counter + 1
Loop

If Rs2.EOF Then
Set Rs1 = Nothing
Set Rs2 = Nothing
Set Db = Nothing
MsgBox "Finished ....."
Exit Sub
Else
Rs2.MoveNext

End If
Loop
End If
End Sub

please help

View 1 Replies View Related

How Do I Email The Program?

Feb 11, 2007

I am using Microsoft Developer and wish to email the program to my customer. With Developer, there are tons of files and a few folders, not just one exe. I realize I must zip to send a exe, but the folders are a problem, since WinZip, which is what I have, will not accept the folders, only files. I could ship like that but it would be a mess on my customer's end. Any suggestion would be helpful.

The reason I want to send this way is just for speed. Of course I can copy to CD and send that way.

Sharon

View 2 Replies View Related

Creating The Program

Mar 6, 2007

I have a database made in MS Access. It has forms that allow the user to do certain things, such as add to the database, and so on. I only want the user to be able to run a program that will run the one, main form i've created it (as well as any other form that the main for lnks to). how do I do this?

View 14 Replies View Related

Stand-Alone Program

May 29, 2007

Hello. I have tried using the search function on the board but I cannot find an answer.

Is it possible to create an executable program to run the database?

I would like to have a computer that does not have Access installed, to be able to load and run the user interface that allows them to manipulate the database, as well as write to it. It doesn't matter if the tables are encrypted or not.

Thanks for your time.

EDIT: It appears that after writing this post, I realized I hadn't used the search term "executable." I found an answer here (http://www.access-programmers.co.uk/forums/showpost.php?p=586646&postcount=2).

View 7 Replies View Related

Program Effiency

Jan 19, 2007

hi,

whenever i key in some data into a form i will transfer the data into a table.
whenever i want to change some data in the form i will delete all the records in the table and re-add all the data from form into the table.

the abv method works. however, i find that it is not effiencent because it every time delete all the records and re-add in records.

how shall i code the program to make it only edit/delete the specific records only instead bulk delete and bulk add?

refer to (program.zip)

Private Sub cmdSaveFltQpi_Click()

Dim Db As DAO.Database
Dim rs As DAO.Recordset
Dim sql As String
Dim f As Form
Dim i As Integer
Dim k As String


Set f = Forms!frmFltQpi
Set Db = CurrentDb()


Call DeleteRecords 'delete all the previous records

sql = "SELECT * FROM [tblFltQpiMonthly] Where tblFltYear = " & f.cboFltQpiYear

For i = 1 To 12 'transfer the data from form to table
Set rs = Db.OpenRecordset(sql)

If rs.RecordCount >= 0 Then

If IsNull(f("txtTotalJobs" & i) Or f("txtTotalRecurring" & i) Or f("txtTotalAirWC" & i) Or f("txtTotalAF" & i)) = False Then

rs.AddNew

rs![tblFltYear] = f.cboFltQpiYear
rs![tblFltMonth] = i

rs![tblFltTotalJobs] = f("txtTotalJobs" & i)
rs![tblFltTotalRecurring] = f("txtTotalRecurring" & i)
rs![tblFltTotalAirtestWC] = f("txtTotalAirWC" & i)
rs![tblFltTotalAirtestFailure] = f("txtTotalAF" & i)

rs.Update

End If
End If

Next i


Db.Close

End Sub

Private Sub DeleteRecords()

Dim sql As String

sql = "DELETE * FROM [tblFltQpiMonthly] Where tblFltYear = " & Me.cboFltQpiYear

DoCmd.SetWarnings False
DoCmd.RunSQL sql

End Sub

View 1 Replies View Related

Help With Reminder Program

Oct 5, 2004

hi!
I'm doing a reminder program this program alerts you if you have things to do each day it has a code that I obtained on the internet wich retrieves the user name. My problem is that when I enter as a user a window shows up say my username and the number of things I have to do but I can't get it to count the number of things to do. I tried a query but it doesn't work (either it shows "#name" or it goes all blank)please help.
thanks in advance, newbiepr

View 4 Replies View Related

Budget Management Program

Oct 12, 2005

I'm just wondering if anyone has made a very advanced budget management program using just access?? I tried to make one for myself but I just want it to advanced for my little knowledge of access. I would love to be able to keep track of all my expenses including everything bought from groceries to hair cuts. I would love to be able to take my receipt from walmart and enter everything bought and the price for each item. Then I would love to be able to at anytime search for soap and thing with soap in the Item name will be displayed with the location and the date and price. This way I can keep track not just what I spend on groceries but what I spend on mountain dew or what i spend on hamburger in a given time. This is just way to complicated for me! I hope someone can help me out here maybe give me a shell and let me try to fill in certain parts or if someone already has one that works kind of like this maybe i could just change a few things to the way i want it! I really appreciate this!!

Bass

View 4 Replies View Related

Program AutoID Field

Feb 9, 2006

I'm, pretty sure the answer to this is a resounding NO, but I thought I'd try it anyway.
I have an AutoID field that records the record number which I then use as a "CaseNo" in the database to track the progress through the system.
Is it possible to program this AutoId to include the year? That is CaseNo 1 would become CaseNo 2005/1.
It would also help to start at 1 again for the first case entered in 2006.
Thanks for any assistance.

View 3 Replies View Related

Is Access 2003 The Right Program For Me?

Aug 3, 2006

Before I start on this seemingly endless journey of learning Access 2003, I thought it appropriate to ask the question;

Will this program do what I need it to do?

I apologise in advance if this is not the right place to ask the question, I am a complete beginner to Access 2003.

I want to make an electronic log book for the guys at work, there are 5 people of different trades who would need to keep the log.

A typical entry would be as follows

Mon 22/3/06 Alan Smith B Shift

Compressor house (heading)
No 1 compressor (plant)
Oil pump (component)
Filter cleaned (action taken)

Personel (heading)
John Jones (personel)
Phoned in sick at 15:00hrs, will phone tomorrow to update

Boiler house (heading)
No 4 boiler (plant)
Water vlave leak (problem)
Tightened gland (action taken)

There are many headings, probably hundreds of plant, thousands of components and actions taken

We would need to view events to particular plant or areas between certain dates, some personel would need to enter data, some would only view the data without being able to enter it, few would need to alter the data.

Is Access 2003 capable of this, should I start the journey?

regards
culedude

View 1 Replies View Related

Simple Access Program, Anyone Help?

Sep 13, 2006

Hello all!

Please forgive me for being a COMPLETE novice at Access, but I am trying!

What I need to do, is have an ordered list, which has check boxes along side each item.

When the relevant items have been checked, I need to be able to save or export to CSV, with ONLY the items which have been checked!!

I need the list to be pulled from a seperate source (like an excel spreadsheet) so that it can be updated easily...

Can anyone help?

so...

Item 1 [X]
Item 2 [ ]
Item 3 [ ]
Item 4 [X]
Item 5 [ ]
Item 6 [X]

would produce a CSV file:

Item 1, Item 4, Item 6,

Simple enough?

View 1 Replies View Related

Access Repair Program

Dec 10, 2006

Greetings:

I am looking for a program that will repair a MsAccess 2000 .mdb file. So far all I have been able to find is those that repair the tables, does anyone know of a program that will repair the entire file including the forms?

Thanks

Mickey

View 2 Replies View Related







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