Goto Record Problem (1 Viewer)

Majid Umar

Registered User.
Local time
Today, 14:12
Joined
Aug 2, 2001
Messages
22
Hi there,

Well, I got these link buttons on forms to jump from say Case Details to Tenant Details. I used Macros to close the current form and open the target form say Tenant Form. But what I tried was to move to the same Tenant Record which was last viewed in Case Details say Case Details were for Tenant 1 so, when goto Tenant is clicked it goes to that particular Tenant.

If anybody can help please ???
 

aqif

Registered User.
Local time
Today, 14:12
Joined
Jul 9, 2001
Messages
158
Hi


There are two ways to do that job


1. Make two Macros

Use OpenForm and specify the where condition as

[TblTenant]![MyField] = Forms![Cases]![MyField]

* TblTennant is the name of tenant table.

Then make a CloseForm action and I hope it will work


2. Write the code behind button

On Error GoTo Err_CmdTenantDetails_Click

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "TenantForm"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

stLinkCriteria = "[CaseField]=" & Me![TenantField]
DoCmd.OpenForm stDocName, , , stLinkCriteria

DoCmd.Close acForm, "FormCases"

Exit_CmdCancerDetails_Click:
Exit Sub

Err_CmdCancerDetails_Click:
MsgBox Err.Description
Resume Exit_CmdCancerDetails_Click

End Sub

The first method is simple and easy and i guess that u r not very much familiar with codes.....so better go for first one...n let me know if ur problem is still unsolved.

Cheers!
Aqif
 

Majid Umar

Registered User.
Local time
Today, 14:12
Joined
Aug 2, 2001
Messages
22
Chase Mate!

That works fine, thanks for your time and help!
 

Users who are viewing this thread

Top Bottom