Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 26th, 2006, 08:26 AM
SlayerX SlayerX is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 1 SlayerX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 47 sec
Reputation Power: 0
Help With Access VBA Coding

Ok so I'm a total noob when it comes to VBA. In fact I don't even know syntax. For work I have to get this project done which involves making an access database. It has been easy so far, but now I have to link two forms together and it's causing me a CRAP load of trouble.

I have three functions pretty much that are called at different times. The first is this:

Private Sub AddDeal_Click()
Requery
On Error GoTo Err_Command173_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Trade"
DoCmd.OpenForm stDocName, , , , acFormEdit, acDialog, Me.[Deal ID]
Exit_Command173_Click:
Exit Sub
Err_Command173_Click:
MsgBox Err.Description
Resume Exit_Command173_Click
End Sub

What this is supposed to do is, open a the "Trade Form" which holds info related to trades and pass to the trade form a deal id.

The second funtion is this:
Private Sub Form_Load()
Dim sOpenArgs As String
sOpenArgs = Me.OpenArgs
[Deal ID] = sOpenArgs
End Sub
When the trade form loads. It copies into a text box the deal ID.

This next thing is where I lose it.
Private Sub AddLeg_Click()
On Error GoTo Err_Command116_Click
DoCmd.GoToRecord , , acNewRec
Call CarryOver(Me.[Deal ID], "")
Exit_Command116_Click:
Exit Sub
Err_Command116_Click:
MsgBox Err.Description
Resume Exit_Command116_Click
End Sub

I know the code is just awful. And very error full. I want this to do two things. 1) When the user clicks on the add trade leg button a new record opens up in the Trade form/table. 2) I want the deal ID to be copied into the additional leg of this trade. If anyone can help me figure out how to do this I would be forever in you debt.

A second thing is how does "Me.Obj" work? I would ideally like for whenever there is a new Deal record, and the user pushes the Add trade button, for the "Me.[Deal ID] passed to be the [Deal ID] of the current record and not the first record.


Anyway, I'd aprpeciate any access help you could give me. Sorry it isn't SQL or MySQL, the guys I work for want it in Access, and I have a crazy deadline of about 7 days, and this si only part of this things functionality.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Help With Access VBA Coding


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT