RETRIEVE and TRANSFER (SUBFORM Issue)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a FINDPROJECT Form…

In this form, I created a “ProjectDetails Subform†wherein all the project
details are displayed.
In my FINDPROJECT Form, I have a RETRIEVE button. This button will be used
to transfer the selected record from the subform and transfer it to another
form.

How am I going to retrieve and transfer a record from a subform to a new form?

What should be the coding….

I am a novice in MS ACCESS….

Please help me…

Thank you..

Amsuria
 
I created a FINDPROJECT Form…

In this form, I created a “ProjectDetails Subform” wherein all the project
details are displayed.
In my FINDPROJECT Form, I have a RETRIEVE button. This button will be used
to transfer the selected record from the subform and transfer it to another
form.

How am I going to retrieve and transfer a record from a subform to a new form?

Well...

Don't.

Data is stored in Tables, not in Forms. Forms are just windows, tools
to look at and work with data stored in tables. You don't need or want
to transfer data from one table to store it redundantly in another
table; it sounds like what you may want to do open another form based
on your table, and display that record. What are you intending to do
with the project data once you've "retrieved" it?

John W. Vinson[MVP]
 
ok, i think i havent explained it well.. my bad..

forget the first one...

i have a PROJECT form. In that form, i have a "Find Project" button. If ill
click that button, the FINDPROJECT FORM will be launched.

In that FINDPROJECT FORM, all the project details wil be displayed in
DATASHEET view inside the SUBFORM.

my question is: How am i goin to retrieve the PROJECTID from the subform of
FINDPROJECT FORM and place it to the PROJECTID in PROJECT FORM?

confusing? sorry, i really dont know how to explain it well..

thanks..
 
ok, i think i havent explained it well.. my bad..

forget the first one...

i have a PROJECT form. In that form, i have a "Find Project" button. If ill
click that button, the FINDPROJECT FORM will be launched.

In that FINDPROJECT FORM, all the project details wil be displayed in
DATASHEET view inside the SUBFORM.

my question is: How am i goin to retrieve the PROJECTID from the subform of
FINDPROJECT FORM and place it to the PROJECTID in PROJECT FORM?

confusing? sorry, i really dont know how to explain it well..

Well, a couple of suggestions.

First, and simplest, just use a Combo Box on the PROJECT form to find
the project. It can contain multiple columns, and can be (when dropped
down) as wide as needed to show all of them. It should be unbound
(nothing in its Control source) and should have a little bit of VBA
code in its AfterUpdate event to navigate to the desired record. The
Combo Box Wizard will give you the option "use this combo to find a
record". No new form, no popups, no (or minimal) code.

If you really want a separate Find Project form, I don't understand at
all why it should have a form (what's its Recordsource??) and a
Subform. Why not just use a continuous Form (rather than a datasheet)
as the popup form? You could put a command button on the detail
section - i.e. on each row of the continuous form - with code like

Private Sub cmdGoToProject_Click()
If Not IsOpen("PROJECT") Then
DoCmd.OpenForm "Project", WhereCondition := "ProjectID = " _
& Me.ProjectID
Else
Forms.PROJECT.SetFocus
Forms.Project.ProjectID.SetFocus
DoCmd.FindRecord Me.ProjectID
End If
End Sub

John W. Vinson[MVP]
 
great..

thanks

John Vinson said:
Well, a couple of suggestions.

First, and simplest, just use a Combo Box on the PROJECT form to find
the project. It can contain multiple columns, and can be (when dropped
down) as wide as needed to show all of them. It should be unbound
(nothing in its Control source) and should have a little bit of VBA
code in its AfterUpdate event to navigate to the desired record. The
Combo Box Wizard will give you the option "use this combo to find a
record". No new form, no popups, no (or minimal) code.

If you really want a separate Find Project form, I don't understand at
all why it should have a form (what's its Recordsource??) and a
Subform. Why not just use a continuous Form (rather than a datasheet)
as the popup form? You could put a command button on the detail
section - i.e. on each row of the continuous form - with code like

Private Sub cmdGoToProject_Click()
If Not IsOpen("PROJECT") Then
DoCmd.OpenForm "Project", WhereCondition := "ProjectID = " _
& Me.ProjectID
Else
Forms.PROJECT.SetFocus
Forms.Project.ProjectID.SetFocus
DoCmd.FindRecord Me.ProjectID
End If
End Sub

John W. Vinson[MVP]
 
Back
Top