473,382 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Problem with my database

Hi folks, thanks for looking. I have a database that takes down order details.
Each customer has there own priceid in the price table, this is due to an opertaional requirment. A group or line discount field is no good.

I Since creating my Price table I cannot acces the add order details subform to choose my products, and there prices.
I set the AddOderDetailsSubform's Rowsource for the Products combo to be::p

SELECT DISTINCTROW Products.ProductID, Price.Price
FROM Products INNER JOIN Price ON Products.ProductID = Price.ProductID
WHERE (((Price.CustomerID)=[Forms]![Add an Order and details]![CustomerID]))
ORDER BY Products.ProductName;

In the After Update event of the control I put
:eek:
Me.Price = Me.ProductID.Column(2)
Im now getting an error where the Add order details subform is not working, I keep getting an sql error saying value after end.
I know nothing of sql/vb, I checked all the forms in the VB window but could not find any data after the end sub.
I am in a real pickle here guys and will be on here all night till I sort it.

I look forward to hearing from you.

Regards
Mark
Mar 27 '07 #1
25 1670
Denburt
1,356 Expert 1GB
You have two columns you post isn't very clear but I do believe that you should be referencing column 1 as Me!roductID.Column(0) Column 2 as Me!ProductID.Column(1)

Your statement should read:
Me!Price = Me!ProductID.Column(1)
Mar 27 '07 #2
You have two columns you post isn't very clear but I do believe that you should be referencing column 1 as Me!roductID.Column(0) Column 2 as Me!ProductID.Column(1)

Your statement should read:
Me!Price = Me!ProductID.Column(1)
Hi I changed that thank you for the help.
What I have found is that when I go into my add order details form I keep getting boxes that as for a parametor value, im dont know why.
I think the db is complex, can you take a look and tell me what I need to do.
Trying to find errors when you cant identify them is proving a nightmare

Thanks
Mark
.
Mar 27 '07 #3
Denburt
1,356 Expert 1GB
O.K. first look at the recordsource and verify you can open that with no issues. Then make sure the controls on that form have a control source that match up with the fields in the recordsource. hope this helps.
Mar 27 '07 #4
HI thanks
I have checked the row source in the products combo box it currently reads
SELECT DISTISELECT DISTINCTROW tblproducts.ProductID, Price.Price
FROM Products INNER JOIN Price ON Products.ProductID = Price.ProductID
WHERE (((Price.CustomerID)=[Forms]![AddanOrderandDetails]![CustomerID]))
ORDER BY Products.tblProductName;.

can you see anything wrong with this.
The add new order form and the sub order form wont open without repeatdly asking me for certain values, like a search field.

I dont know if its my queries that are wrong, maybe that is why the forms dont work.
I have just made sure that all fields within my table have a value in them.

Dont really know where to go from here, I think the problems could be narrowed down to queries, forms, & onfiguration of events.

Thanks
Mark
Mar 27 '07 #5
Denburt
1,356 Expert 1GB
Right off I would suggest that you avoid naming a field the same as that of your table (Price.Price), that said.

The add new order form and the sub order form wont open without repeatdly asking me for certain values, like a search field.
Does it say "search" field on the prompt and are you sure it is this combo box? What exactly does the text on this prompt state. I am sure it probably has the name of a field it is looking for. Root around in the recordsource to start then hit all your combo boxes rowsources.
Mar 27 '07 #6
Right off I would suggest that you avoid naming a field the same as that of your table (Price.Price), that said.



Does it say "search" field on the prompt and are you sure it is this combo box? What exactly does the text on this prompt state. I am sure it probably has the name of a field it is looking for. Root around in the recordsource to start then hit all your combo boxes rowsources.
Hi the errors that I get say enter parameter value for
products.unit price
Unit Price
Discount Price

Maybe a bit of history would help with this, the user said originally that they wanted to be able to give custoners a discount on every line of stock.
Then realised after completion that this is no good. The only option is to give each customer there own price list.

I have made big changes at the table level and the inherent errors are crawling can someone take a look at it and tell me what to do to sort it, pretty pls.

Thanks
Mark
Mar 27 '07 #7
I have the structure
tblCustomers
CustomerID Autonumber and key
then other non relevent field at the mo

tblOrderDetails
OrderDetaiID Key
OrderID
ProductID
Quantity
Price

tblOrders
OrderID Key
CustomerID
OrderDate
PurchaseOrderNumber
ShippingMethodID
Payment Received
Comment

tblPrice
PriceID Key
ProductID
Price
CustomerID

tblproducts
productID Key
ProductName
Cost
If you r not getting the info you need can I send you copy of the db.
Thanks
Mark
Mar 27 '07 #8
Denburt
1,356 Expert 1GB
Open your order form in design view look at the properties section and view the recordsource. I am sure you will see several fields in there that contain what you are looking for. Such as "products.unit price" change to COST and "Discount Price" remove or replace with necesary field name....
Mar 27 '07 #9
Open your order form in design view look at the properties section and view the recordsource. I am sure you will see several fields in there that contain what you are looking for. Such as "products.unit price" change to COST and "Discount Price" remove or replace with necesary field name....
Hi it dsays
SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity, OrderDetails.Discount FROM OrderDetails;

so im gonna edit it to

SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity, OrderDetailss;
Mar 27 '07 #10
Denburt
1,356 Expert 1GB
Uh it looks like you only grabbed part of that SQL statement.
Mar 27 '07 #11
Uh it looks like you only grabbed part of that SQL statement.
erm
Sorry you lost me.
Mar 27 '07 #12
The record source for the addorderdetails subform is
SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity, OrderDetails.Discount FROM OrderDetails;
The record source for the order details subform is
Total Price of Order Details

Does this help.
thanks
mark
Mar 27 '07 #13
Denburt
1,356 Expert 1GB
so im gonna edit it to
SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity, OrderDetailss;
No way that will work.

First I asked for the recordsource form the Orders form and you posted:
Expand|Select|Wrap|Line Numbers
  1. SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity, OrderDetails.Discount FROM OrderDetails; 
  2.  

It Should read:
Expand|Select|Wrap|Line Numbers
  1. SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity FROM OrderDetails; 
  2.  



Then for the subform you pasted the same...
On your main form you would use the orders table the subform would have the details table. If you remove the bolded statement then you should look on the form for a control that has a controlsource to Discount and remove that also. I think we are making some headway.
Mar 27 '07 #14
Denburt
1,356 Expert 1GB
tblOrderDetails
OrderDetaiID Key
OrderID
ProductID
Quantity
Price
Is orderdetailID mispelled only in here or in your table also?
Mar 27 '07 #15
so im gonna edit it to
SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity, OrderDetailss;[/quote]

No way that will work.

First I asked for the recordsource form the Orders form and you posted:
Expand|Select|Wrap|Line Numbers
  1. SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity, OrderDetails.Discount FROM OrderDetails; 
  2.  
superb, Thank You. let me just check through somthing with you
the forms I have are
AddanOderandDetail
AddorDeleteCustomer
AddorDeletePaymentMethods
AddorDeleteProducts
AddOrderDetailsSubform
ChangeOurCompanyInformation
CustomerOrdersSubfrorm
Reports
ViewReports

I just thought it might be useful
Thanks
Mark



It Should read:
Expand|Select|Wrap|Line Numbers
  1. SELECT OrderDetails.OrderDetailID, OrderDetails.OrderID, OrderDetails.ProductID, OrderDetails.Quantity FROM OrderDetails; 
  2.  



Then for the subform you pasted the same...
On your main form you would use the orders table the subform would have the details table. If you remove the bolded statement then you should look on the form for a control that has a controlsource to Discount and remove that also. I think we are making some headway.[/quote]
Mar 27 '07 #16
Denburt
1,356 Expert 1GB
Looks like your rolling, any more questions feel free to post.
Mar 27 '07 #17
You a star what can I say superb. Thanks

I made sure that the orderentry form's record was set as advised.
I did the same for the OrderDetailOrderForm,
Thinking back with this in mind I may have set up the products raw source to this value rather than what it should be, rather than where it was ment for, the record entry box.

I also ge a Syntax error (missin operator in query expression tblPrice INNER JOIN tblProducts.ProductID = tblPrice.ProducrID.

I persume this means missing () <>{}

I have also gone through the Macro's and objects checking that spelling and removal of spaces.

Thanks
Mark
Mar 27 '07 #18
Hi is anyone out there lol, thanks for all your help goin bed
Mar 28 '07 #19
Denburt
1,356 Expert 1GB
also ge a Syntax error (missin operator in query expression tblPrice INNER JOIN tblProducts.ProductID = tblPrice.ProducrID.
The button options... (dmn I am tired) debug what is the yellow line?

We need the full sql statement (that is the error) trying to run at that moment (not ALL the code couple of lines maybe).
Good night.
Mar 28 '07 #20
The button options... (dmn I am tired) debug what is the yellow line?

We need the full sql statement (that is the error) trying to run at that moment (not ALL the code couple of lines maybe).
Good night.
Morning campers
Mar 28 '07 #21
The button options... (dmn I am tired) debug what is the yellow line?

We need the full sql statement (that is the error) trying to run at that moment (not ALL the code couple of lines maybe).
Good night.
Hi im not sure what it is you need.

Thanks
Mark
Mar 28 '07 #22
Hi im not sure what it is you need.

Thanks
Mark
I think this is related to the ordersubform
Private Sub cmdAddNewRecord_Click()
On Error GoTo Err_cmdAddNewRecord_Click

DoCmd.GoToRecord , , acNewRec
Forms![Add an Order and Details]![Order Details Subform].Form.Requery
Forms![Add an Order and Details]![OrderSubTotal].Requery
Forms![Add an Order and Details]![OrderTotal].Requery

Exit_cmdAddNewRecord_Click:
Exit Sub

Err_cmdAddNewRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewRecord_Click

End Sub
and this is the addneorder form.


Err_cmdCloseOrderForm_Click:
MsgBox Err.Description
Resume Exit_cmdCloseOrderForm_Click

End Sub


Private Sub Delete_Current_Order_Click()
On Error GoTo Err_Delete_Current_Order_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.GoToRecord acDataForm, "Add Order and Details"


Exit_Delete_Current_Order_Click:
Exit Sub

Err_Delete_Current_Order_Click:
MsgBox Err.Description
Resume Exit_Delete_Current_Order_Click
End Sub

Private Sub Print_Click()
On Error GoTo Err_Print_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Print_Click:
Exit Sub

Err_Print_Click:
MsgBox Err.Description
Resume Exit_Print_Click

End Sub

Private Sub cmdInvoice_Click()
On Error GoTo Err_cmdInvoice_Click
Dim stDocName As String
Dim stlinkcriteria As String

stDocName = "Report1" '/ Replace my report name with "Invoice"..
stlinkcriteria = "[CustomerID]=" & Me.CustomerID & "And [Orderid]=" &
Me.OrderID
DoCmd.OpenReport stDocName, acPreview, , stlinkcriteria

Exit_cmdInvoice_Click:
Exit Sub

Err_cmdInvoice_Click:
MsgBox Err.Description
Resume Exit_cmdInvoice_Click

End Sub
Private Sub Command121_Click()
On Error GoTo Err_Command121_Click

Dim stDocName As String
Dim MyForm As Form

stDocName = "Add an Order and Details"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False

Exit_Command121_Click:
Exit Sub

Err_Command121_Click:
MsgBox Err.Description
Resume Exit_Command121_Click

End Sub
Private Sub Command122_Click()
On Error GoTo Err_Command122_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Command122_Click:
Exit Sub

Err_Command122_Click:
MsgBox Err.Description
Resume Exit_Command122_Click

End Sub
Private Sub Command123_Click()
On Error GoTo Err_Command123_Click

Dim stDocName As String

stDocName = "Invoice"
DoCmd.OpenReport stDocName, acPreview

Exit_Command123_Click:
Exit Sub

Err_Command123_Click:
MsgBox Err.Description
Resume Exit_Command123_Click

End Sub

Is this what I need to edit. I havent a clue where

Regards
Mark
Mar 28 '07 #23
I have removed all the spaces between Table names.


Regards
Mark
Mar 28 '07 #24
Im still not working erm dont know what to try,
How much would someone charge me to have a look at th database and resolve its issues.


Thanks
Mark
Mar 28 '07 #25
Denburt
1,356 Expert 1GB
tblProducts.ProductID = tblPrice.ProducrID
Are both fields Numerical such as the tblProducts.ProductID is probably an autonumber and make sure tblPrice.ProducrID is set to number. Then we should check your relation ships.


Search for the following line in the code you sent:
Expand|Select|Wrap|Line Numbers
  1. stlinkcriteria = "[CustomerID]=" & Me.CustomerID & "And [Orderid]=" &
  2. Me.OrderID
Change it to this:
Expand|Select|Wrap|Line Numbers
  1. stlinkcriteria = "[CustomerID]=" & Me.CustomerID & " And [Orderid]=" &
  2. Me.OrderID
Might be the problem.
Mar 28 '07 #26

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mithun Verma | last post by:
Hello All, I have a Windows application that uses Crystal Reports 9 (bundled Version) developed using VS.NET 2003 on a windows server 2003 m/c. The application has to be deployed on the client...
3
by: Jagdip Singh | last post by:
Hi, We are facing problem accessing to DB2. Seems like database manager is down I tried starting it using db2start but it was neither showing any messages nor returning to command prompt...
2
by: Robert Stearns | last post by:
After working well for most of a week, my application with the mysterious php/db2 problem is now failing again. No one has worked on the php code this week. We're running DB2 8.1.5, php 4.3.6...
2
by: Robert McGregor | last post by:
Hi all, I've got a Front End / Back End database that was working just fine. One day i opened the FE to find that if I tried to open one of the linked tables from the database window, nothing...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
4
by: Reinier Beeckman | last post by:
Hi got the following problem, it's more a programming problem then really a database problem. I have a Database class which connects to a mySQL database on the network. In WebForm1.aspx i connect,...
3
by: Juan Antonio Villa | last post by:
Hello, I'm having a problem replicating a simple database using the binary log replication, here is the problem: When the master sends an update to the slave, an example update reads as follows:...
22
by: b_r | last post by:
Hi, I'm trying to make a simple operation (insert into DB) in VB 2005 and SQL Server. The code is as follows: Dim sConnectionString As String = _ "Data...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
5
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi, I wonder if someone could shed some light on this one for me. I have developed a web app in VS2005 with the built in server. It uses an sql database, everytihng works. I need to test it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.