Opening subform datasheet link data to the main form (1 Viewer)

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
Hi guys,

I'm just quite very new to ms access 2010 and I'm kinda learning this in the hard way. So I hope you can assist me on this....

How do I link a data(id) on subform datasheet to open data to the main form for editing? And this main form is on the 3rd tab page.
The main form on the 3rd tab and its subform datasheet are linked together.

I only know via a macro feature "Open form" but this will only open another window. I just want it to open on the same current window & tab.

Maybe it's only possible if I do it on VBA but I kinda sucks on coz I have no background at all...:confused:

I hope you guys can assist me... thanks....
 

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
how about just open the subform(datasheet) to the main form when a row is clicked or selected on the subform(datasheet)?
 

vbaInet

AWF VIP
Local time
Today, 23:44
Joined
Jan 22, 2010
Messages
26,374
So I don't understand why you want to create a button on the subform to create a new record on the parent form. Why don't you put the button on the main (or parent) form?
 

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
I actually want is that when a hyperlink id's is clicked it will open to the main form. This main form is sitting on the 3rd tab of another form as another subform.

 

vbaInet

AWF VIP
Local time
Today, 23:44
Joined
Jan 22, 2010
Messages
26,374
I get you now. So what you want to do is put the code in the Click event of the ID textbox. But is the subform on the 3rd tab linked to any form?
 

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
Yes it is. That subform where the id's are displayed are actually a form in datasheet view. Then I added that as a subform to a main form where the input fields are displayed for editting or new record. But I made the main act a subform again on the 3rd tab of another form as displayed above.
You can check that file here you can understand it more ...

Thanks
 

vbaInet

AWF VIP
Local time
Today, 23:44
Joined
Jan 22, 2010
Messages
26,374
I think you are miscommunicating your problem.

What is the caption of the 3rd tab? Is it Qualifications?
Where is the Hyperlink field located? And on what tab?
 

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
The hyperlink are the ID's encircled on the the subform as seen on the screenshot above.
Basically I just want to know how to an on click event when the an ID is click it will open to the form above(mainform). It's like a split form...
If only split forms works as subform I can have datasheet below and it's form above but it doesn't work.....
 

vbaInet

AWF VIP
Local time
Today, 23:44
Joined
Jan 22, 2010
Messages
26,374
Alright, you want to move the parent record to the record that's clicked on the subform.

Put this in Click event of that control:
Code:
If Not Me.NewRecord Then
    Me.Parent.Recordset.FindFirst "ID = " & Me.ID
End If
 

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
That works.... Thanks but.....

I have to set in the parent form property to Data Entry as "NO" for that to work. If I set it "Yes" the parent starts as empty form which it suppose too but the on click event on the IDs it will no longer work.
How can I make both work? start the parent form as an empty form and make the on click event on the ID's also work correctly...
 

vbaInet

AWF VIP
Local time
Today, 23:44
Joined
Jan 22, 2010
Messages
26,374
So the main form is only for adding new records, nothing else?
 

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
I intend it to act as both. But I just want to start the main parent form first as a blank/empty form. And also work as an edit area form when an ID's is click on the subform.....
Is it possible?
 

vbaInet

AWF VIP
Local time
Today, 23:44
Joined
Jan 22, 2010
Messages
26,374
Set the parent form's Data Entry property to No before you run th code.
 

slansh

Registered User.
Local time
Today, 15:44
Joined
Nov 24, 2011
Messages
22
Okay.... it now works great.... Thanks a lot....
I really appreciate your help.... :) :D :D

Now I only have one problem left... perhaps on another thread again....
 

Users who are viewing this thread

Top Bottom