you are in the wrong section, this is a Visual Basic discussion group
ChrisPadgham 113 Posting Whiz
you are in the wrong section, this is a Visual Basic discussion group
It seems that Access 2010 has a habit of corrupting the VBA project file. the The solution to the problem is to create a shortcut to the database then edit its properties to /decompile to the target. Run this and it will repair the database
I think the problem is more that the spreadsheet is treating the data as numbers if you altered the formating in the spreadsheet to treat it as text it may solve your problem
Presuming you hold year first enrolled in the Student table you are best to use a calculated field in a view that concatenates these to fields
YearEnrolled & '-' & StudentId AS StudentNo
Probably cost is never being set. Your code is not robust because it does not cater for all situations, for example it does not cater for weights greater than 100. If you can't accept weights > 100 you should cater for that in the code and display an error message.
it would help if you formated your text but I can only see one loop in code
Dim intCount As Integer = 1
Dim intStore As Integer
Dim strStars As String
Dim intDividedBy As Integer
intCount = 0
Do
intCount = intCount + 1
intStore = CInt(InputBox("Enter the sales for store number " & intCount.ToString()))
intDividedBy = intStore /100
strStars = intDividedBy.tostring & "*"
lstChart.Items.Insert(0, "Store " & intCount.ToString & ": " & strStars)
Loop While intCount < 5
The error means that the object you are passing to the subroutine is not a combo box or the subrountine declaration is not correct.
you need to use the isnull or nz function for example
If not isnull(tradeReceivable) Then
sqlStr = sqlStr & " receivable = '" & CDbl(tradeReceivable) & "',"
End If
if the value of tradeReceivable is null then you do not need to include it in the SQL it will be null by default
or
sqlStr = sqlStr = " receivable = '" & nz(tradeReceivable,0) & "',"
can I suggest you download the Core Data lecture from iTunes by Paul Hegarty of Stanford University. I think you will find it helpful.
In Xcode, choose File -> New File. Then, in the dialog window select Core Date in the left pane and select Data Model. Then click next, give you model a name. This is where you create your datamodel, XCode handles the SQLlite interface on your behalf.
If you want to learn how to do this I suggest downloading from iTunes the Standford University lecture on Core Data by Paul Hegarty it is quite good.
In answer to the first question, drop the statement creating the autorelease pool
and
[object release]
[pool drain]
statements
NSString is an object
NSRange is a foundation data type, ie not an object, and as such does not require the *
Place this code in the click event of a button should do the job
docmd.OutputTo acOutputReport,"Myreport",acFormatPDF,"c:\myreport.pdf"
You would be better to put it under a double click event on the list box. ie the user double clicks the name to move it to the other box. it is simple to implement and is faster and easier for the user to use than drag and drop.
open "c:\myfile.txt" for output as #1
write #1, "here is some text"
close #1
There are bar code fonts you can download and install on your PC for the purpose. Just google "barcode font" and you will find plenty. Using this font you can print barcodes on your normal laser on A4 etc however if it is for a shop you may want to consider buying a barcode printer that prints on small sticky labels
Possibly change the extension on the file before you open it. You can do this using the FileSystemObject
It looks like you are storing the values in a numeric field and it is trying to interpret the values as decimal numbers. Change your field definitions to "Text" and it should bring everything in OK.
The relationships between Customer Order and OrderProduct is wrong.
The tbl_Order should have the CustomerId as a foreign key not tbl_Order_Product.
Does anyone have any experience using curl from MS Access. I would appreciate some pointers,
No Joy I am afraid, it is leaving a temporary file when it falls over called VBFF3C.tmp containing
VERSION 1.0 CLASS
BEGIN
Multiuser = -1 ' True
END
It seems to me that there are some serious bugs in the VBA compiler in this version
I have just started using Access 2010 and am experiencing problems with it corrupting the database. To take one example I have a database with one module in it. Today when I open the module in design view Microsoft Access falls over with the error "Microsoft Access has stopped working" Compact and repair does not fix it. you can't import objects into another database because that causes Access to fall over as well.
It is a recurring problem and it is driving me batty. Has anyone any ideas on what is going on.
under the File tab click on "Save & Publish" in the right pane you will see .mdb format as one of the options. It will not let you use it however, if you have used any features specific to 2010 in the database
use a combo box linked to a database field
this forum is to solve specific problems, if you have a specific problem you need help with then provide the details. It is not to do your work for you.
if you are talking about writing two files at the same time then it simply a matter of opening them on different file unit numbers
open "text1.txt" for output on #1
open "text2.txt" for output on #2
print #1, "this will go in text1"
print #2, "this will go in tesxt2"
close #1
close #2
Use the Alignment property of the text box to specify left or right alignment
how do you want to connect it, via a serial port or USB
if you only want an integer
if isnumeric(txtr.text) then
if int(txtr.text)=val(txtr.text) then
OK
else
msgbox "Only integers please"
exit sub
end if
else
msgbox "Please enter a number"
exit sub
end if
You need to use Set when you are assigning objects but not when you are assigning variables.
What precisely do you want to do, do you want to load an image from a file into an image control?
Your first step is to work out your data model. Think about the data elements you want to store and how they relate to one another.
If you wish to read the contents of a directory you would be better to use the filesystem object.
I presume you are populating from the object MyRecSet1. If you have populated this recordset why not just check the RecordCount property to see if there are any rows returned and disable the remove button if there are no rows.
By online/offline i presume you mean when you are connected to the central system or not. You should always store and edit in you local branch database. You will then need to synchronise this periodically with your central database.
The simplest way is to simply delete and reinsert the records each time you wish to synch.
DELETE * FROM LoanCentral WHERE BranchId=MyBranchId
INSERT INTO LoanCentral (BranchId, LoanId, ......) SELECT BranchId, LoanId ..... FROM Loan
one other thing. I think you will need to use
Randomize
at the top of your program to get a truely random number, other wise you get the same sequence of numbers each time you run the program
I think your first effort looks OK, you just need and Exit Sub after line 6.
are you testing to see if an item has actually been selected by the user.
SO what is the error message.
it would be simpler to put a login button on the screen and put the code under that.
Also you need to ensure the variable counter is declared at the module level otherwise it will be reinitialised each keypress and be useless to you.
To state the obvious it sounds like the data source is invalid. What type of data source are you trying to connect to.
Investigate a UNION query if you want the data from both tables at once
This was my code from a previous post. It uses three if blocks with the same condition because each if block will alter the value of books remaining.
The problem is in the Click event, you do not call the function the line
Text2.Text = Points
should read
Text2.text = CalcPoints(val(text1.text))
You should also use the
Option Explicit
compiler directive, which requires all variables to be declared. It can be painful at compile time but it is worth it at run time.
You can have it included automatically by checking "Require Variable Declaration" in the options.
You are hijacking someone else's thread Fred. Please start your own.
Even if you are using five databases, if you ultimately want to consolidate the data you will need a branch identifier in every table. Thus you will have a compound key in every table.
eg for Loan Table
BranchId
LoanId
for Customer table
BranchId
CustomerId
The limitation you are building into this design is that if a customer moves from one branch to another you will need to have a way of migrating his records
The difficulty is that count() works against summarising existing rows in a table. By definition a count of 0 means that no rows exist so nothing will appear. How would SQL know what the missing values were. To address the problem you will need to set up a reference table with all the valid values in it and do an outer join against the table with the data in it.
In the VB6 IDE (integrated development environment) the thing you develop your applications in.
The "Screen" object will give you the size of the screen
Debug.Print Screen.Height, Screen.Width
Sorry that was VB6, try
Debug.Print(Screen.PrimaryScreen.Bounds.Height)
In the IDE click on the Project menu item then select References. At the top will be the libraries that are selected for the project. The troublesome one should have "Missing" in the description.
Yes, I think that SQL always uses mm/dd/yyyy regardless of the regional settings of the PC. Also you may like to consider that these are date/time fields so the time may be a factor if you are missing some records.
The SQL is correct, there must be something wrong with your data.