redeem a course item (1 Viewer)

shutzy

Registered User.
Local time
Today, 10:27
Joined
Sep 14, 2011
Messages
775
i am hoping that this is possible. i have uploaded some tables and a form.

on the form i want to dbl click an item and if that customer has course items remaining on a course that has an equal ItemID as the one selected then enable radio button x

they way the courses and course items are linked is

tblCourses (CourseID | CourseName | ItemID | ItemQuantity | CoursePrice | ExpiryDate)
tblCourseItems (CourseItemsID | CourseID | ItemsID | CourseItemPrice(this is theindividual price, from tblCourses.CoursePrice / ItemQuantity))

then in tblClientCourse is where the records for the course purchases are kept and remaining amounts.
ClientCourseID | OrdersItemsID | ClientDetailsID | DatePurchase | DateExpiry | ItemsRemaining)

i would like to say

PrivateSub frmDepartures-PriceChange_OnLoad()
IIf [tblClientCourse].[ClientDetailsID]=[Forms].[Departures].[ClientDetailsID] where [tblClientCourse].[ItemsRemaining]>0 and IIf [tblCourseItems].[ItemsID]=[Forms].[DeparturesPaymentScreen].[ItemList].[Column](2) then RadioButton.SetProperty=Enable

ElseIF RadioButton.SetProperty=Disable
EndSub

if you cant follow this then please dont be mad. its my first attempt at vba from scratch. wether the method will work or not i dont know but i need to be able to get this in before i can answer that. so if you guys dont mind correcting this for me it will be very much appreciated.

oh and i would like to put this in frmDeparturesPaymentScreen-PriceChange

thanks graham
 

Attachments

  • FirstVBAAttempt.mdb
    592 KB · Views: 67

Addyman

Registered User.
Local time
Today, 02:27
Joined
Dec 29, 2011
Messages
90
oh and i would like to put this in frmDeparturesPaymentScreen-PriceChange

You don't have a form called that, you have one called frmDeparturesPaymentScreen and one called frmDepartures-PriceChange. Which form are you referring to?

Do you have a copy of this database you could upload with the other tables in it? Right now none of your forms work in the version you have uploaded. Makes it slightly awkward to see what you are trying to accomplish. I believe there should be a client table?
 

shutzy

Registered User.
Local time
Today, 10:27
Joined
Sep 14, 2011
Messages
775
sorry it is frmDepartures-PriceChange

ive uploaded the whole database with sensitive info removed.
 

Attachments

  • FirstVBAAttempt.zip
    1.6 MB · Views: 82

shutzy

Registered User.
Local time
Today, 10:27
Joined
Sep 14, 2011
Messages
775
ive managed to do what i want in a query(well at least get a result) now all i need to do is put this into a form and say if ItemsRemaining>0 then SetProperty.RadioButton.Enable

how do i do this with the sql below

SELECT tblClientDetails.ClientDetailsID, tblClientCourse.ItemsRemaining, tblCourseItems.ItemsID
FROM tblClientDetails INNER JOIN (((tblCourses INNER JOIN tblClientCourse ON tblCourses.CourseID = tblClientCourse.CourseID) INNER JOIN tblOrdersItems ON tblClientCourse.OrdersItemsID = tblOrdersItems.OrdersItemsID) INNER JOIN tblCourseItems ON tblCourses.CourseID = tblCourseItems.CoursesID) ON tblClientDetails.ClientDetailsID = tblClientCourse.ClientID
WHERE (((tblClientDetails.ClientDetailsID)=[Forms]![frmDepartures]![ClientDetailsID]) AND ((tblClientCourse.ItemsRemaining)>0) AND ((tblCourseItems.ItemsID)=[Forms]![frmDepartures-PriceChange]![ItemsID]));
 

Users who are viewing this thread

Top Bottom