UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Form Prompts For A Parameter, Access 2013    
 
   
dflak
post Nov 22 2017, 01:04 PM
Post#1


Utter Access VIP
Posts: 6,016
Joined: 22-June 04
From: North Carolina


Slogging along on my training database.

I launch frm_lk_exercise and I click on the Edit Button. I am expecting that it launch frm_exrecise_roster for the selected exercise number. Instead, I get a prompt for tbl_exercise!exe_FK_exercise. If I fill in the prompt manually with a 1 or 2, it brings up a blank form instead of the form associated with the exercise number.

I've stared at it all morning and still haven't got an idea of why it's not launching properly.

CODE
Private Sub But_Edit_Click()
DoCmd.OpenForm "frm_exercise_roster", acNormal, "", _
    "[Forms]![frm_lk_exercise]![lk_exe_ID]=[tbl_exercise]![exe_FK_exercise]", _
    acEdit, acNormal
End Sub

Attached File(s)
Attached File  Unit_Training.zip ( 312.55K )Number of downloads: 4
 

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
DanielPineault
post Nov 22 2017, 01:09 PM
Post#2


UtterAccess VIP
Posts: 5,450
Joined: 30-June 11



I think you want

CODE
Private Sub But_Edit_Click()
    On Error GoTo Error_Handler

    DoCmd.OpenForm "frm_exercise_roster", acNormal, , "[lk_exe_ID]=" & Me.lk_exe_ID, acEdit, acNormal

Error_Handler_Exit:
    On Error Resume Next
    Exit Sub

Error_Handler:
    MsgBox "The following error has occured" & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: But_Edit_Click" & vbCrLf & _
           "Error Description: " & Err.Description & _
           Switch(Erl = 0, "", Erl <> 0, vbCrLf & "Line No: " & Erl) _
           , vbOKOnly + vbCritical, "An Error has Occured!"
    Resume Error_Handler_Exit
End Sub

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...
Go to the top of the page
 
dflak
post Nov 22 2017, 01:21 PM
Post#3


Utter Access VIP
Posts: 6,016
Joined: 22-June 04
From: North Carolina


Thanks. I was just sniffing at that tree when you came up with the answer - I'm *not* trying to go cross-table here. Yes, the code works just fine.

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    12th December 2017 - 03:23 AM