open form based on record

hziggy

New member
Local time
Today, 04:18
Joined
Feb 4, 2003
Messages
6
I have looked for an exact description of my issue and have not found one. I apologize if I a repeating. I have a data entry form called bugIdentifier. I also have a form that lists all bugs. I want to put a button next to each bug that will show their details. The problem is that my bugIdentifier form is set to come up in a new record for data entry. Anyone got a solution?
 
As you are collecting errors by data entry I would have a table (although I don't know what info you want to collect) with this structure:


tblErrors
ErrorID
DateOfError
NameOfUser
ErrorSummary
DescriptionOfError


Then I'd use a listbox on a form with three columns (ErrorID, DateOfError, and ErrorSummary) ensuring that the first column (ErrorID) is hidden.

Then, on the AfterUpdate() event of the listbox I'd open a pop-up form with its recordsource set to the table (tblErrors) and filter it with respect to the value of Column(0) in the listbox. This popup form would should all of the error details.
 
Thanks but basically I have the forms designed and everything. I have a from that I would like to use as a data entry form and then also as a read only form for a particular record. Right now the form opens blank for a new record. I need it to also open for a particular record based on a selection on another form.
 
On the form's load put this:

If Me.OpenArgs = True Then DoCmd.GotoRecord , , acNewRec


On the calling form which opens the details to view a record:

DoCmd.OpenForm "frmYourForm", acNormal, , "[ErrorID] = " & Me.txtErrorID, , , False *

When calling the form to add a record:

DoCmd.OpenForm "frmYourForm", acNormal, , , , , True


* I'm assuming here that you have the primary key for your errors on the form stored in a hidden textbox.
 
Just for information's sake, what we've done is used a form property called OpenArgs.

When opening a form you can send information to the new form's openargs, so we sent a boolean value to your display/edit form

You display/edit form, when it opens, evaluates its openargs (sent from the calling form) and makes a decision of what the user wants to do based on the boolean value.
 

Users who are viewing this thread

Back
Top Bottom