|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Help With Access VBA Coding |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|