OPen Form B from Form A with related records

P

Peter

Hi again

I receive syntax error on the following

DoCmd.OpenForm("Single
View",[ViewAsAcFormView=acNormal],,[WhereCondition:"Case ID ="&Me.Case ID])
all i want to do is to open Form B from Form A with related records by
klicking on a command button...
 
G

golfinray

The command button will set that up for you using the openargs portion of the
docmd function.
 
A

Allen Browne

This should work provided Form B is not already open:

Dim strWhere As String
If Me.Dirty Then Me.Dirty = False 'Save first
If IsNull(Me.[Case ID]) Then
MsgBox "Select a case first."
Else
strWhere = "[Case ID] = " & Me.[Case ID]
DoCmd.OpenForm "Form B", WhereCondition:=strWhere
End If
 
P

Peter

Thank you! Thank yuo! Thank you! Beer is on me when you visit Prague.:)

golfinray said:
The command button will set that up for you using the openargs portion of the
docmd function.
Peter said:
Hi again

I receive syntax error on the following

DoCmd.OpenForm("Single
View",[ViewAsAcFormView=acNormal],,[WhereCondition:"Case ID ="&Me.Case ID])
all i want to do is to open Form B from Form A with related records by
klicking on a command button...
 
D

Dirk Goldgar

Peter said:
Hi again

I receive syntax error on the following

DoCmd.OpenForm("Single
View",[ViewAsAcFormView=acNormal],,[WhereCondition:"Case ID ="&Me.Case
ID])
all i want to do is to open Form B from Form A with related records by
klicking on a command button...


Did you not see my reply when you asked this same question two days ago in
the GettingStarted group?
 
P

Peter

Dirk...i appologize, i did not. I am new to this kind of forum and it takes
time to undderstand the routines...once again...i am sorry.

Dirk Goldgar said:
Peter said:
Hi again

I receive syntax error on the following

DoCmd.OpenForm("Single
View",[ViewAsAcFormView=acNormal],,[WhereCondition:"Case ID ="&Me.Case
ID])
all i want to do is to open Form B from Form A with related records by
klicking on a command button...


Did you not see my reply when you asked this same question two days ago in
the GettingStarted group?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
D

Dirk Goldgar

Peter said:
Dirk...i appologize, i did not. I am new to this kind of forum and it
takes
time to undderstand the routines...once again...i am sorry.

No problem; it just seemed strange that your question didn't change, and I
thought I'd answered it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top