Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




AS Computing Coursework - Comboboxes And Databases Question And Help


please download the project so far from:

http:\www.studentforums.hostultra.comComputing.zip

copy the "Tod's Tyres" folder to "c:program files"

then if you open the project in VB, and run the frmJobs, u can see the combo box near the bottom with two text boxes below it.

when i select something in the combo box, the text boxes change to relate to it, but then i scroll through all the records using the "browse jobs..." section the text boxes do not change to correspond to the combo box?

how do i make this happen - it would be appreciated if you post the code here for me.

also, when i click on new job, all text boxes are blanked apart from the two in question so i need these to be blanked too.

i am a newbie at vb (only started to use it last week) so any help is greatly appreciated

thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
AS Level Computing Coursework
hi, i am taking as level computer this year and i don't know any programming language, but the simplest i can probs learn is vb so i am going to give that a go.

i need tips on where i should start with this - i basically don't know anything!

this is the coursework i have to do:

AS Practical Exercise for
Summer 2004 Examination
Tod’s Tyres
19.2 The following Practical
Exercise is for Summer 2004
Examination only
19.3 Background Tod's Tyres is a small business which supplies new car tyres to
company car fleets and car hire firms.
You have been asked to create a computer application, either
programmed or using a database, to replace the current manual
record-keeping system. Initially, at least, there will be only one standalone
workstation with a printer attached. This is to be kept locked in
the office.
For the purposes of this exercise, you may assume that all the cars
have the post-2001 format car registration number. Eg AB 03 XYZ
19.4 Current System 1. When a car is brought to Tod for the first time, the following
information is recorded on a card: car registration number, company
name, type of tyre fitted. Each time that car has new tyres the date,
car mileage, and number of new tyres fitted is recorded on the card.
There is also space to make a comment; for example, the mechanic
fitting the tyres may have noted some other problem with the car,
which they would bring to the notice of the customer so that it could
be sorted out. When a card becomes full, a new card is stapled to the
original one. These cards are filed in car registration number order.
2. The next time the company books in a recorded car for new tyres,
Tod checks the card file to see what type of tyre that car has fitted.
He then ensures that he has the required tyres in stock. He prides
himself that he never lets a regular customer down.
3. Tod gets his tyres from one supplier only. This supplier sends him an
up-to-date supplier price list once a month. Todd then adds his
fitting costs to produce a customer price list. The current price list is
as follows.
Computing - Advanced Subsidiary and Advanced, 2004 examination

Type Manufacturer’s Code Customers’ Price
(Ex VAT)
155/80S13 P1000 £36.00
165/80S13 P3000 £39.00
155/80S14 P5000 £58.50
165/80S14 P7000 £64.00
4. Some companies are allowed a 5% discount before VAT is added. At
present, Tod does not keep a record of who these are because he can
remember them. However, a computerised system would have to
keep a record.
5. VAT is payable at the current rate.
6. Tod keeps company details, (Company name, contact name, address,
post code and telephone number), in another card file.
7. Tod supplies an invoice to his customers. This invoice is supplied in
duplicate, one copy for the customer and one for Tod’s own records
for his accountant. It has an invoice number in the top right hand
corner. It details the date, the company name, post code and
telephone number, the car registration number, the number of tyres
supplied with their price, the discount where applicable and the VAT.
8. Once a month, one of the clerks goes through the cards and pulls out
cards for cars which last had new tyres over a year ago and so might
be ready for new tyres. Tod then sends the customer a standard letter
reminding them that the tyres are ready for replacement, and quoting
them a price.
9. Tod also intends to use a popular word processing package. He
wants to use the Internet and e-mail in the near future, and possibly
have his own Web site. He feels that a move into electronic
communication would be beneficial to his business.
You should bear these plans in mind when designing your system,
although you are not expected to incorporate these applications for
this exercise.
Testing Car registration numbers should be validated and the number of tyres
sold for one vehicle at any one time should not exceed 5. Testing
should ensure that the calculations produce the correct result.
Advanced Subsidiary and Advanced, 2004 examination - Computing

19.5 Requirements of the Practical
Exercise
Candidates will need to design and implement an appropriate
computing system and provide sufficient documentation to
demonstrate the following practical skills.
• Design
• Implement/Test. For the purpose of this exercise, the actual
implementation of the sending of the standard letter to
customers (paragraph 8 in 19.4 above) is not required,
although thought should be given as to how this would be
implemented.
The task may be undertaken by:
either writing a program in a chosen high level language
or using a suitable application package.
Candidates are expected to produce brief documentation including
some or all of the following, as appropriate.
Design
• Definition of data requirements
• User interface design including output, forms and reports
• Method of data entry, including validation
• Record structure, file organisation and processing
• Security and integrity of data
• System design
Implementation/Testing
• Details of test plan with explanation, and evidence of testing
having been carried out
• Hard copy output of the invoice, with and without discount
• Hard copy of solution e.g. annotated program listing/database
tables, forms and reports.
This documentation is to be brought to the examination and handed
in with the candidate’s answer script for Unit 3 (CPT3) at the end of
the examination. A Cover Sheet, signed by the teacher and the
candidate, authenticating the work of the candidate, must be attached
to the documentation (see Appendix B).
Computing - Advanced Subsidiary and Advanced, 2004 examination

this has been copied from adobe acrobat so it mybe a slight mess, but if u want to see the actual pdf then download this file:

http://www.aqa.org.uk/qual/pdf/AQA-...511-W-SP-04.pdf

and look at page 43

i could do with tips on how to go about this and what i need to learn etc

thanks

Help Needed Urgently On Visual Basic Computing Coursework. Will Pay Money!
I need help on the programming of my very simple program in visual basic. It is very very basic programming its just I am very bad at programming. If any1 can spend a little time helping me I will be very grateful as this is due in for a weeks time. Please send me an email to ************************************** if you could spend a bit of time to help! You can also add me to msn messenger if you have it. My name for that is *********************************************

Comboboxes And Databases? Do They Work Together?
can i use a combobox to access a database and display/update info on my forms like a data control does?

Databases And VB Comboboxes, Array Help
Hey, [you], I'm wondering if you can help me.
I'm using an array of 25 comboboxes and when the program starts up it goes throu all 25 of them and adds a list of data from the database.

BUT now, when I select an item from one of the boxes, I want it too fill in to textboxes to the left of it with data. I the problem I'm having is when I select an item from the pull-down, it will only fill in the first couple comboboxes in the array, and not all the time.

This Code Works, It adds the partnumber from the database to all 25 of the combo boxes on form load

Code:
Set db9 = DBEngine.Workspaces(0).OpenDatabase(App.Path & "inventory.mdb")
Set rs9 = db9.OpenRecordset("Inventory")
While Not rs9.EOF
Do Until temptxt = 24
CmbParts(temptxt).AddItem (rs9!Partnumber)
temptxt = (temptxt + 1)
Loop
temptxt = 0
rs9.MoveNext
Wend
This is the code in ComboParts_Click sub for when I select a item from the combobox.

Code:
Set rs9 = db9.OpenRecordset("Inventory")
Dim temptxt As String
temptxt = 0
While Not rs9.EOF
If CmbParts(temptxt).Text = rs9!Partnumber Then
TxtDesc(temptxt).Text = rs9!Description
txtPer(temptxt).Text = rs9!RetailPrice
TxtQty(temptxt).Text = 1
txtTotal(temptxt).Text = 0
temptxt = (temptxt + 1)
Else
If CmbParts(temptxt).Text = "" Then
txtPer(temptxt).Text = ""
TxtDesc(temptxt).Text = ""
txtTotal(temptxt).Text = ""
TxtQty(temptxt).Text = ""
temptxt = 0
End If
End If
rs9.MoveNext
Wend
Something is reall goofy and I don't know what it is. Please Help

Large Project - Databases, Comboboxes, Etc.
I am working on a pretty big project that is eventually going to implement some kind of database. Let me explain the jist of the project:

My work involves saving a lot of .pdf files. Yes, a lot! I have to manually look at each one and name it according to the type of file and client name, etc. just so we can find them later. Right now there are 26 folders named A-Z and each client has their own folder within these. There are 5 folders within each client folder to separate the .pdf files into categories. Then the filename within that folder contains the rest of the information. Naming and sorting each file and then trying to find them later simply takes too long!!! So now for the fun part - programming!

I have already implemented a way to get the pdf into my program and to save it, but I still need to program and design the rest. I plan on having combobox's for the client name, category, file info, etc. So there are two routes to go from here:

What do you think would be best:
1. Have the file saved in the format I am currently using? When I save the pdf, it formats the filename so it can be found manually?

2. Use a different format for the filename so that only the program/saving database knows what the file is just by looking at it. For example - use 0122-324-32451.pdf instead of LastName, FirstName - Filetype - Info - Date.pdf

The database would store the information and my program would have a find form that searched the database for whatever the user wanted.

What do you guys think? and is there anyone willing to help me on some kind of IM with some of the database work?

Thanks!
koskilla

Coursework Fun.. :|
Hey all.. just having a little problem in my coding

Basically, my vb application is connected to my database when a customer places an order it is automatically added to the database in an order table. Recording their customer id, order number, order date, time, price ect.

Each customer can only place 5 orders. I am having a problem with that, right now a customer can place as many orders as they like. I have been trying this is as far as i have got:

This is using data environment..

If rs1.State > 0 Then
rs1.Close
End If

search = Combo1.Text
query3 = "SELECT * FROM Orders WHERE Orders.CustomerID=" & search & ";"
rs1.Source = query3
rs1.CursorType = adOpenDynamic
rs1.LockType = adLockBatchOptimistic
rs1.Open

If Val(search) > 5 Then
MsgBox ("this should show an error...")
Else


End If

right now all it does is if the actual customer id is greater than 5 it brings up an error not the number of entries by that customer

Can anyone help?

Thanks

VB For Art Coursework
I've made a program that creates random patterns on the screen. But i don't know how to get it to print out during run-time.
Please help, I need it for my Art Coursework.

School Coursework
I am doing a access database for gcse coursework. It has to be about the school library system. My question is how do i get a automated message saying which books are overdue. i have never used VB before and neither has my teacher so i dont know where to begin. Any help is appreciated

A-Level Coursework Help Needed
Hi, I am currently in the process of programming my courswork. Basically I am doing a shift/rota system for a supermarket. There are 15 tills for which i need to have data for. These are: Morning Cashier, morning break, lunch break, afternoon break, evening cashier and evening break. There are 14 days for which i have to have this for, (2 week timetable), each day has a master rota for which some of the above fields never change e.g. on one day, the same cashier will work on a certain till every other week etc. To program this data into the database, the ontly way i could think of doing it, is have a field for every piece of data, and having 14 records (one for every day of the two week timetable) however this means for one record there is 100 or so pieces of datam which gave me overflow, and which is just stupid anyway. This data needs to be read by a form which has loads of text boxes, and i was going to do a table which had a record for each till, and all the tills would have a day id, however i cant have day ID 1, and have 15 tills with this day id, because it is unique so it wont let me. Does anyone have even the faintest idea what i should do coz i am officially stuck. Any advice would be really really helpful, you have no idea....

Thanks, and sorry for the huge post,

Squiddles

Dynamic Searches (vb Coursework)
i am trying to create a function in VB5 to search for either low stock or zero stock levels.

Private Sub cmdsearch_Click()
Dim mySQL As String
Select Case strSearch
Case "Low Stock"
strSearch = "1"
Case "Zero Stock Count"
strSearch = "0"
End Select

mySQL = "SELECT * FROM [STOCK] WHERE [NumberInStock] = '" & strSearch & "'"
datStock.RecordsetType = vbRSTypeDynaset
datStock.RecordSource = mySQL
datStock.Refresh

End Sub

says something about a data type mismatch
can anyone tell me why this isnt working? really need some help here

A2 Computing
Hi I’m currently starting the second year of my a level computing course in England, I need to decide on a project for my second year and was wondering if u guys have any ideas? I did have the idea of designing a online fantasy formula 1 system where you pick the top 3 drivers for the next race and a given points accordingly, but this would need lots of clever server end stuff that would not count toward my project there for a waste of time, most people are doing a inventory or membership system but this will be boring as I have done many things like this already, I want something not overly complicated but not to simple and some thing out of the ordinary, any ideas would be much appreciate, cheers in advance, Sam.

Computing Normals
Can anyone know formula for computing a triangle's (three vertices) normal
I want vb code like this
Function ComputeNormal(v1 As D3DVECTOR, v2 As D3DVECTOR, v3 As D3DVECTOR) As D3DVECTOR

Computing Time
hi i have problem on this code.

Code:
Const SECONDSPERMINUTE As Long = 60
Dim Starttime As Date
Dim Endtime As Date
Dim dblTime As Double
Dim dblCost As Double
Dim dblCharge As Double
Dim totalcostperhour as integer

Starttime = "11:00:00 PM"
Endtime = "12:00:00 AM"
dblTime = DateDiff("s", Starttime, Endtime)
dblTime = dblTime / SECONDSPERMINUTE
dblCharge = dblTime / SECONDSPERMINUTE * 20
totalcostperhour = Int(dblCharge)
on this code the dblCharge returns - sign if the date of endtime is differ from the date of starttime. how can i compute it correctly? please help.. thanks

Computing Time
hello..
I would like to ask how to compute the time using vb. like in Internet Cafe, to get the total charge per hour. thanks please help.

Computing Subtotal
The code is listed below and I'm not sure how to introduce a subtotal at one of the line insertions. I'm sure that it needs to be placed @ the if <>0 statement, but I'm not sure how the subtotal formula is drafted.
n = 3
For n = 3 To 999

If (Cells(n, 1)) = "" Then

Selection.PasteSpecial paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

different_month = DateDiff("m", CDate(Cells(n, 5).Value), CDate(Cells(n - 1, 5).Value))

Else: GoTo 12

End If

If different_month <> 0 Then

Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown

Cells(n, 6).Select
ActiveCell.FormulaR1C1 = "Monthly Total"
Cells(n, 1) = Subtotals(3, A1, A10) 'this is obviously wrong'
End If
End If
Exit For

12 Next n

ML Used For Matrix Computing
I upgraded Matlab to 2007a and my program (enharited) stucks when comes to do Compute (see below).
"Tips": If I activate a (fake/"tester") file between Call MLEvalString("LogRet") and Sheets("Test").Select lines, the program goes on but, of course, I get errors later. If I use "MD" instead of "LR" in Call MLGetMatrix("LR", "B11") line I advance a bit, but I overflow later.

Sub Compute_returns()
' until here I already selected a matrix of data
Call matlabinit
Call MLPutMatrix("MD", Selection)
Call MLEvalString("LogRet")
Sheets("Test").Select
Call MLGetMatrix("LR", "B11")
MatLabRequest
Call Compute
Application.CutCopyMode = False
End Sub

Help In Computing Due Date
hi guys,
i was trying to sort all projects that are already due and show them in a grid
im having trouble computing dates... this is the code i used..

VB Code:
txtSearch.Text = Datestrdate = txtSearch.Text Set rsProject = dbSSS.OpenRecordset("Select * from Project where DateFinish < '" & strdate & "*'")

i used this to show the projects that have due dates that are less than than the date today.

what if i wanna show the projects that will be due 1 week from now? [due date (less)-7days]

THANKS

Not Computing Correctly
i have this code in my Amountdue textbox
VB Code:
For i = 1 To lstStocks.ListItems.Count      cAmountDueTemp = CCur(cAmountDueTemp) + CCur(lstStocks.ListItems.Item(i).SubItems(5))      txtAmountDue.Text = Format(cAmountDueTemp, "###,###,##0.00")    Next

this one is on lostfocus event of cashpayment
VB Code:
Private Sub txtCash_LostFocus()  txtCash.Text = Format(txtCash.Text, "###,###,##0.00")End Sub

and this is how i compute for the change
VB Code:
If txtCash.Text = "" Then    MsgBox "Please Pay the amount of Php " & txtAmountDue.Text, vbInformation, ProgName    txtCash.SetFocus    Exit Sub  ElseIf Val(txtCash.Text) < Val(txtAmountDue.Text) Then    MsgBox "Cash Payment is less than the Total Amount Due.", vbInformation, ProgName    txtCash.SetFocus    SendKeys "{home}+{end}" 'Highlight text    Exit Sub  Else    txtChange.Text = Format(Val(txtCash.Text), "###,###,##0.00") - Format(Val(txtAmountDue.Text), "###,###,##0.00")


why is it that if the value in Amountdue textbox is 1,012.00 and i typed 500 in my cashpayment textbox and then when i click the button for computation is not correct it should display "Cash Payment is less than the Total Amount due" instead is display you change is 499.

What is happening here?

Parallel Computing
I received an e-mail today from my IST professor and he asked me to do a project for him to place myself in another course. He asked me to code a program in Visual Basic to demonstrate parallel computing on a network system. I haven't done anything like this before, but I am pretty familiar with using Visual Basic. I don't know where to start. There is a program called SETI (Search for Extra Intelligence), check out SETI@Home. I guess it's something like that, on the lines of using other computer to crunch numbers and such, only I'm not looking for aliens. Can anyone give me some insight?

AS Computing: Visual Basic Help
OK, i got about a week left until my computing coursework needs to be in, and i still cant get my program to work.
The program is for my uncles business and i have to complete the "bookings" section of the program. There are 4 things that the user can do in the bookings section, add, view, edit and delete. I have got the add and view section to work, but the edit and delete are prooving difficult.

I have attatched the program (visual basic file) and i would greatly appreciate it if someone could have a look at the code for edit and delete and tell me why it is not working.

Computing The Age Base On Birthdate
Hello. I'm a newbie in VB. Can anyone tell me on how to make a birthdate and compute the age base on the birthdate?

Mobile Computing Solution
I am currently in the "R" phase of R&D. I am creating a VB application that will utilize a desktop database on the users laptops. At radom intervals the users will dial in to a central server and sync up their data with the current data on the server. This will go both ways, they will upload their latest while retrieving new data on the server. If anyone knows of a case study that I can look at please let me know. Also, if anyone has some interesting thoughts or ideas, please share them. Thanks.

Computing Time Problem
I have two label for time which shows hour, minute, and second called Login and Logout. What is the code to convert the difference between them in decimal?
This is the code that I used:

Code:
dim hours as double

hours=logout-login

The error said data type mismatch. Let say per hour payment is $30. How to compute using the code?
Thank you.

Computing Date And Time??
Okay, so far I've been able to create two systems during the course of my life as a student programmer -- but during this whole time, I'm still unable to determine how to compute for the time and date.

Like getting how many days have passed on these values:
02/02/2008 | 03/03/08
or...
12:46am and 8:45pm.

Can anyone help me compute for these values? I'm guessing that you need to convert the time to 24-hour format so that you can compute it. Tho, I don't know what to do with date values...

Please and thank you?
Rie

Distributed Computing Ideas
I've been a programmer for about 6 years now and like to programm in VB. I just have gotten so bored recently because I have no motivation to program anything and can't think of anything useful to program. Distributed Computing such as Prime95 and SETI have recently caught my attention. I want to make a distributed computing program in VB, but I don't know what the computers should be solving. Does anyone have any ideas and/or want to work on this with me? Any good math ideas will probably do as long as they aren't like Prime95 since that is always going to be the most popular and nobody will catch up to it. Thanks.

P.S. - I posted this already in the project area, but haven't gotten any response or any views recently. I am very sorry about me reposting this, and i assure you that i will delete one of the threads once i start getting feedback from one of them. Thanks.

A-Level Computing Project
As you have probably guessed I've left my project until very late. Could anybody please email/post a Visual Basic A-level project, it can be just the first year (AS level) project. If it makes anybody feel better I'm not going to copy it I just need it too give me a good guideline to what is acceptable. I am planning to produce a project for a library database. It is for the WJEC exam board and it involves using Access database aswell. Does anybody know of any websites that would be of any use to me? Any replies will be greatly appreciated.


Email: Richard9fd@aol.com

Computing Unions Of Sets
I'm having a hard time designing an algorithm to compute a union of a bunch of sets on closed intervals.
For example if you have sets like these:
[5,10] [2.2,3] [1,2] [3.1,7] [1.5,2.5], the algorithm should return [1,3] [3.1,10].

Also how would you merge x number of linked lists (already sorted) into one (also sorted) linked list.

In both cases I'm looking for as efficient design as possible.

Thanks
Q

Macro: Computing Monthly Returns
Hi,

I'd like to get monthly returns with a macro, i.e. [soit (B4-B2)/B2, then (B6-B5/B5), etc.] . The manual solution cannot be envisionned as the colums are full.

My datas are disposed like this:

Code:
A B C
1 Date Amount Monthly return
2 03/03/1997 6
3 17/03/1997 1
4 31/03/1997 7
5 07/04/1997 6
6 21/04/1997 4
7 05/05/1997 1
8 19/05/1997 7
9 02/06/1997 3
10 16/06/1997 6
11 30/06/1997 1
... ...
The following macro may be useful, it permits to get monthly average :



Code:
Sub Test()
Dim i%, k%, Resultat As Single, v
Do Until IsDate(Cells(i + 1, 1).Value)
i = i + 1
Loop
Do While IsDate(Cells(i + 1, 1).Value)
v = Cells(i + 1, 1).Value
Do While Month(v) = Month(Cells(i + 1, 1).Value)
Resultat = Resultat + Cells(i + 1, 2).Value
i = i + 1
k = k + 1
Loop
Cells(i, 3).Value = Resultat / k
Resultat = 0
k = 0
Loop
End Sub
Thank you for your help

Computing Checksum For Bin Mode Access
Hi , I am new member

I want to learn how to compute checksum for file with bin access mode,,,,,, like:

Code:
000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F
404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F
808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F
A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF
C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF


The results & the digest when I used Hex workshop editor program gave me these values in HEX:


CRC-16 = BA D3
CRC-32 = 29 05 8C 73
I know how to compute CRC Algorithm & I have the vb souce code


Checksum-8 = 80
Checksum-16 = 7F 80
Checksum-32 = 00 00 7F 80
Checksum-64 = 00 00 00 00 00 00 7F 80
I do not know how to compute them & I do not have the source code too ,

If some would like to help :D




Regards

Formatting And Computing Time Data
In my project I have a mskeditbox that collects an expiration date in the form of 0105 as input. When I used the following code(editted to only show the relative code):

VBCode
Dim myDate As Date
    Dim rightnow As String
    myDate = CDate(frmDSReg.MskCCExpires)
    rightnow = FormatDateTime(Date)
/VBCode

the variable myDate contains 4/14/1900 instead of 01/05 like it is supposed to.
A description of what I am trying to do is:
    1.Get an expiration date from a credit card
    2. Verify that it is an actual date (not 13/06)
    3. Compare it against the current (today's) month and year to make sure the card is not expired.
    4. Go on to perform other processes that I have already coded.

I hope this explains things well enough for everyone to understand. I have searched through MSDN and the VBCity site for anything about validating date functions but I am not getting this. Thanks for any help and Happy Holidays.
Later,


Cliff R.
Mesa, AZ
Check out my website at http://crogers.org
Being an organ donor is giving the greatest gift that someone can give.
It is giving the gift of life. Please register to be an organ donor.

Checking Two Databases In Access For Something (databases Have No Relationship)......
Hi:

Thought this was something that was not related to my last thread so starting another one.

In my access database, I have two tables, one called Users that holds user information who are authorized to use the program and the other table called Inventory that I need to check for the Product Quantity, if it equals to or is less than 2, then to show a prompt.

However, when I attempt to add the check for the Inventory database, it's just not working. I get the following error:

Quote:





run-time error '3265':
Item cannot be found in the collection corresponding to the requested name or ordinal.






It points to

VB Code:
txtUsername.Text = rs.Fields("Username").Value


This part is located in the Users database. If I take out everything for checking the Inventory database, then everything works fine. So it has to be related to that.

I am sure I am going the wrong way but I need to find out how I can check two databases that are not related in any way and can't be joined with something that is unique because both tables in the same database hold different information.

Thanks in advance for your guidance.

Sub below:

VB Code:
Private Sub cmdLogin_Click()    Dim SQL As String    Dim conn As ADODB.Connection    Set conn = New ADODB.Connection        Dim rs As ADODB.Recordset    Set rs = New ADODB.Recordset        conn.CursorLocation = adUseClient    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _               "Data Source =Database.mdb;" & _               "Persist Security Info=False"        SQL = "SELECT Username, Password, AuthLevel FROM Users WHERE Username = '" & txtUsername.Text & "' AND Password = '" & txtPassword.Text & "'"    conn.Execute SQL        'Inventory has no relationship to Users so cannot be joined.  Need to    'be able to check both databases on login.    SQL = "SELECT ProductQuantity FROM Inventory"    conn.Execute SQL        'UNCOMMENT NEXT LINE TO DEBUG THE SQL STATEMENT    Debug.Print SQL        rs.Open SQL, conn, adOpenKeyset, adLockOptimistic        If Not (rs.BOF And rs.EOF) Then        txtUsername.Text = rs.Fields("Username").Value        txtPassword.Text = rs.Fields("Password").Value        frmMain.Show        Unload frmLoginForm    Else        frmAccessDenied.Show vbModal    End If        If rs.Fields("AuthLevel").Value = 1 Then        'do nothing to the buttons or the drop down menu options in the interface    Else    With frmInternalSplash        .cmdAddProduct.Enabled = False        .cmdDeleteProduct.Enabled = False        .cmdEditProduct.Enabled = False        .cmdDeleteClient.Enabled = False    End With        With frmMain        .mnuAddProduct.Enabled = False        .mnuEditProduct.Enabled = False        .mnuDelete.Enabled = False    End With        With frmCompanyInformation        .txtCompanyName.Enabled = False        .txtAddressLine1.Enabled = False        .txtAddressLine2.Enabled = False        .txtCity.Enabled = False        .txtState.Enabled = False        .txtZipCode.Enabled = False        .txtPhone.Enabled = False        .txtFax.Enabled = False        .txtEmail.Enabled = False        .txtWebsite.Enabled = False        .cmdModifyCompanyInfo.Enabled = False        .cmdClearCompanyInfo.Enabled = False    End With    End If        'This is where you check the Inventory database and if it equals to or    'equals less than two, send a prompt on login    If Not (rs.BOF And rs.EOF) And rs.Fields("ProductQuantity").Value = 2 Or rs.Fields("ProductQuantity").Value < 2 Then        frmProductQuantityAlert.Visible = True    Else        frmProductQuantityAlert.Visible = False    End If        rs.Close    Set rs = Nothing    conn.Close    Set conn = NothingEnd Sub

Computing Functional Dependency Of A Access Table
--------------------------------------------------------------------------------
Anyone have any idea how can i computing the functional Dependency of a Access Table???? For example in the table of employee table.. most fields should be dependent on the primary key...

For example, in my table there are fields like,
personId, Name, Surname, age, date of birth,Area code, telephone number, address, country.

I would like to compute the Functional Dependency for each field.. Which meant a column C1 is functionally dependent if the valuse of C1 uniquely implies another column C2 x% of the time, where x is a user specified value.

Therefore in my table..
1)Name, surname,telephone number, address, country functionally depend on the personId.

2) age depend on Date of birth because age is a derived value, from the current date and date of birth

3) Area code depend on the country.

The x% is the dependacy percentage...fully dependent or partial depend, maybe due to 2 primary keys in the table.

we shouldnt store age in the table, tat wat i want to detect in my porgram. I'm trying to develop a tool tat allow user to analysis their Access DB.

In this case of the age, we shouldnt stored derived column, age, in the table, because we could compute using the DOB. This also means tat Age is functional dependent on DOB. I want to detect these type of relationship. In another words, i will like to analyse the relationships between column within a table.

The main aim of my program is to analysis any ACcess DB. To detect normalisation and To analyse that if is there any First, 2nd or 3rd Normal form

Multi Processing (Distributed Computing) [ UN-RESOLVED ]
How can I write an app that uses cpu resources on multiple computers on a network? A clever solution using shell would be ok. For example, I would need 3 networked computers to simultaneously operate on the same database.

Any ideas or references greatly appreciated!

Computing Functional Dependency Of A Access Table
Anyone have any idea how can i computing the functional Dependency of a Access Table???? For example in the table of employee table.. most fields should be dependent on the primary key...

For example, in my table there are fields like,
personId, Name, Surname, age, date of birth,Area code, telephone number, address, country.

I would like to compute the Functional Dependency for each field.. Which meant a column C1 is functionally dependent if the valuse of C1 uniquely implies another column C2 x% of the time, where x is a user specified value.

Therefore in my table..
1)Name, surname,telephone number, address, country functionally depend on the personId.

2) age depend on Date of birth because age is a derived value, from the current date and date of birth

3) Area code depend on the country.

The x% is the dependacy percentage...fully dependent or partial depend, maybe due to 2 primary keys in the table.

we shouldnt store age in the table, tat wat i want to detect in my porgram. I'm trying to develop a tool tat allow user to analysis their Access DB.

In this case of the age, we shouldnt stored derived column, age, in the table, because we could compute using the DOB. This also means tat Age is functional dependent on DOB. I want to detect these type of relationship. In another words, i will like to analyse the relationships between column within a table.

The main aim of my program is to analysis any ACcess DB. To detect normalisation and To analyse that if is there any First, 2nd or 3rd Normal form


"General Computing" Bulletin Boards
Not a VB question but here goes anyway ...

Does anyone know of any bulletin boards - of a similar standard to VB-World - where we can post and get answers to a wider range of computing topics?

Such as:
Windows
Misc software problems
Misc hardware problems

I'm sure other users of this board would benefit from this as well as me!

Thanks in advance.

Computing Date From Mix Of Date && Week Number.
I am given a date in the form month/Week Number/Year. (Why it's being passed like this is a whole other matter)

So, 01/03/2006 would mean "The 3rd week in January", 02/04/2004 would mean "The 2nd week of Febuary"...

Does anyone know of a quick & dirty way of converting this to a standard date? We're looking for something that goes to the first day of the specified week, in our case Sunday.

So 01/03/2006 would convert to 01/15/2006
02/04/2004 would be 02/22/2004

Any ideas would be appriciated & Thanks.

ID's On ComboBoxes
How someone can add in ID in a combox
for example Instead of cbo.AddItem Description &" - " & ID
to have visible only the Description and keep internally in a property of combo the ID. I tried with index but it has severe limitations
Thanks in advance

Comboboxes
Hi, I am writing a form that let's you choose different options in the combobox. What I want is this:
If the value of the first combobox is a certain one AND the value of the second combobox is a certain one THEN return a number. Whatever I do I can't make it work: I always get the same number in return. Here is the code:

If cmbShowName.Value = "The Nose" And cmbArtists.Value = "Rehearsal Rentals" Then
ActiveCell.Offset(12, -1).Value = "'10054909200030"
ElseIf cmbShowName.Value = "The Nose" And cmbArtists.Value = "Transportation" Then
ActiveCell.Offset(12, -1).Value = "'10054909210030"
End If

The resulting number is always the first one (10054909200030), even if I choose something else in the second combobox.

Any suggestions pls?

Thank you in advance

Giana

Comboboxes
hi people,
I have only just started just visual basic and need some help in entering data into a combo box, what code would i use?

Comboboxes
Hi all,
I need your help. I'm doing a project, and in this project i have two comboboxes, to test my user, they have to select the right list heading in the combobox. My problem is i keep getting an error message saying "wrong number of arguements or invalid property assignment". Does anyone know what i have done wrong?

Here's the code:

Private Sub cmdok_Click()
If txtend = "" Then
MsgBox ("Error - enter text into the caption box")
Else
If txtend.Text = "End" Or txtend.Text = "END" And cmbdeclarationfra15("MnuExit") = True And cmbclick("Click") = True Then
lblfinishtest2.Caption = "Finished"
End If
End If

End Sub


eh i'm confused help!!

ComboBoxes?
Does anyone know how to put the contents of a dir in a ComboBox?

ComboBoxes
Is it possible to change the a specific item added to the combobox into a different colour?

ie. You have a combobox that displays alll books on loan but also displays those books that are overdue in lets say vbRed.

Is this possible and if not what control should I use (if any)?

ComboBoxes
This is probable easy, but I just dont get it. How do I set a value to an item in a combobox? For example, If the user selects "1", then make a TextBox print "one"? I tried If..Then but that doesnt work for me. Any help or references would be appreciated.

ComboBoxes
I recently asked how to add something to a comboBox, but now I need to know how to remove something from a combobox...
I tried something with removeitem, but it didn't work. Thank you very much for your help!

Help With COMBOBOXES
Hi guys, my application has various textfields which get populated by the user information such as Name, Address, City......etc. All this information is retreived from an Access database table. I also have 2 combo boxes on the same page. These are called MonthOfBirth and Region. Month of birth holds all 12 months and the Region holds all 13 canadian provinces and 50 states. This is ok if I'm entering and saving data to the table. But when I try to retrieve data from the table, these combo boxes do not get populated with the correct name of the field from the table. For example: if a customer lives in Washington, the combo box should automatically scroll to WASHINGTON in the list. I've tried this piece of code:

Set cboRegion.DataSource = PointsRecs
cboRegion.text = !REGION

Set cboMOB.DataSource = PointsRecs
cboMOB.text = !MONTHOFBIRTH

But I keep getting an error saying the 'text' property is read only.

Any advice?

Comboboxes
I have a combo box, it has 4 options, Angle, Commerical, Match, Interview. I want a 'frame' grouping to appear as soon as I select "Match" but it doesn't want to appear? What am I doing wrong ?

Private Sub cmboSeg_Change()
If cmboSeg.Text = "Match" Then group1on1.Visible = True
End Sub

VB6 Comboboxes And SQL
I've tried and tried, but can't seem to get this. I'm very new at SQL programming in VB and I've looked everywhere I can think of. Ok, here's the problem. I'm using this code to populate a combobox:

Private Sub Form_Load()
Dim DbName As String
Dim TableName As String
Dim FieldName1 As String
Dim FieldName2 As String
Dim FieldName3 As String
Dim Search As String

DbName = "mydb.mdb"
TableName = "MyTbl"
FieldName3 = "Field3"
FieldName2 = "Field2"
FieldName1 = "Field1"

Search = "SELECT " & FieldName3 & " FROM " & TableName & " WHERE " & FieldName2 & " = 0 " & " ORDER BY " & FieldName3

Cat2.Data1.DatabaseName = DbName
Cat2.Data1.RecordSource = Search

Cat2.Data1.Refresh
Cat2.Combo1.Clear

Do While Not Cat2.Data1.Recordset.EOF
Cat2.Combo1.AddItem Cat2.Data1.Recordset.Fields([FieldName3])
Cat2.Data1.Recordset.MoveNext
Loop
End Sub

Please don't ask why I used DATA instead of ADO, long story. Anyway, this code works fine for populating my first combobox. My problem is that I need to populate a second combobox based on what's selected in the first. And a third combobox based on the second. But it's not quite that easy. Field1 is distinct numbers, say 1 through 400. Field 2 is another set, some dupicate, some are not, but they relate to field1. Field3 is names. When the first combo is selected, I need the second to populate based on the value of field2 equaling the value of field1.

Field1...Field2...Field3

1.........3.........Text1
2.........3.........Text2
3.........5.........Text3 <---my example selection
4.........63........Text4
5.........76........Text5

So, if the value of combo1 = field3(text3), then I need combo2 to populate field3(text1,text2) based on field1(3) equaling field2. PLEASE HELP ME!! I'm going insane trying to get the syntax correct. I just can't figure it out. And to top this all off, I need the value of field1 stored as a string. So in the above example, text3 is selected in combo1, the value of field1 needs to be saved in a string. If data in combo2 (which should now be populated) is selected, the string needs to update to field1 based on that value. I'm confused. Please help. I can send example data if anyone needs it. If you're willing to help but just don't get what exactly I'm asking, please feel free to e-mail me : laserjames@hotmail.com

James

2 Comboboxes
Hi
I have on my VB form 2 comboboxes:The first combo box contains the language option:English,French and Spanish and the second combobox contains a list of cities from England,France and Spain.Upon clicking on the first combobox and choosing a language,I want the second combobox to display only the cities belonging to the language I chose.Note that the second combobox is connected to a table in SQL server and It displays the records of the table called Cities.
Thanks a lot

Help With ComboBoxes
I'm creating a database that allows you to select a name off of a datacombo, and then edit it through text boxes. The problem is, when I update the info, I can't get the darn combobox to refresh unless I close the entire application. I thought maybe someone could help me here.

This is the code I'm using to refresh the datacombo

cboLastName.RowMember = " "
Dedata.rsComboCoach.close
cboLastName.RowMember = "ComboCoach"

Any suggestions would be great.

Copyright © 2005-08 www.BigResource.com, All rights reserved