PDA

View Full Version : Is it possible to run code in access 2007 developed in access 2003?



wedd
11-24-2010, 06:05 AM
Is it possible to copy code from access 2003 to access 2007 and the code will work without any issues? I've created checkboxes that on click I can click on separate boxes; which work exactly the same on acc 2003, howev,r the differences is that prices which also is coded do not appear in a blank (deposit) text box in access 2007 but this action is carried out in access 2003. Any reasons why I'm able to perforn different actions based on the code and why other actions are not able? Can this be corrected, so that I'm able to see the prices automatically appear in access 2007 just like I do in access 2003?


Thanks for your contributions:friends:

OBP
11-24-2010, 09:08 AM
Wedd, I have provided lots of Access 2003 vBA code that works fine in 2002.
However there are few pieces of code that fail translation for some reason.
What does your code say?

wedd
11-24-2010, 09:38 AM
OBP, here is my code:

Private Sub fraOrganisations_AfterUpdate()
Dim curDeposit As Currency
Dim strError As String
Select Case Me.fraOrganisations
Case 1 ' Maitland Park Sports Centre
curDeposit = 100#
Case 2 ' Queens Crescent Community Centre
curDeposit = 200#
Case 3 ' Fleet Community Centre
curDeposit = 100#
Case 4 ' Equipment
curDeposit = 100#
Case Else ' oops
strError = "unexpected value for fraOrganisations: " & _
Me.fraOrganisations
End Select
If Len(strError) > 0 Then
MsgBox strError
Else
Me.txtDeposit = curDeposit
End If
End Sub

hansup
11-24-2010, 11:15 AM
This looks like a continuation of another of your questions. I responded on Nov. 4, but never heard back from you.

http://www.vbaexpress.com/forum/showpost.php?p=229137&postcount=26

OBP
11-25-2010, 10:28 AM
wedd, you also d not say what it does or doesn't do?