Change Format

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Another Question from Andrew.

I have a table [Contracts] with a field [Contract_Number], text field, no
duplicates. This table is maintained by in house (Back end). Users of the
database (Front end) fill out routine data on forms which fill up several
tables. Queries are used to compile data for reports, most of which is the
same however depending on [Client] the format of the form must change. I have
designed several forms to meet their “Particular needsâ€. Is there a way to
fire off the info to the right form (using a print form button) based on
[Contract_Number] ?

Any help as always is greatly appreciated.
 
On Tue, 9 Feb 2010 16:44:06 -0800, Andrew

You're not giving enough information to answer that question. You say
that the form changes based on Client. Then you ask if given a
ContractNumber you can open the right form?
Logic dictates no, unless the ContractNumber has a code embedded that
reveals the Client, or unless given the ContractNumber we can lookup
the Client.
The latter seems somewhat likely. Perhaps you could write:
dim ClientID as Long
dim strFormName as string
ClientID = DLookup("ClientID", "Contracts", "Contract_Number=" &
ContractNumber)
select case ClientID
case 1
strFormName = "FormForClient1"
case 2
strFormName = "FormForClient2"
case else
strFormName = "FormForOtherClients"
end select
docmd.openform strFormName
(of course you have to change my object names to yours)

-Tom.
Microsoft Access MVP
 
Sorry! It would be just as easy to refer to [client] as opposed to contract
number. The Contract Table has both [Contrcact_No] and [Client] as part of
its required data.
--
Andrew
H.W. Lochner


Tom van Stiphout said:
On Tue, 9 Feb 2010 16:44:06 -0800, Andrew

You're not giving enough information to answer that question. You say
that the form changes based on Client. Then you ask if given a
ContractNumber you can open the right form?
Logic dictates no, unless the ContractNumber has a code embedded that
reveals the Client, or unless given the ContractNumber we can lookup
the Client.
The latter seems somewhat likely. Perhaps you could write:
dim ClientID as Long
dim strFormName as string
ClientID = DLookup("ClientID", "Contracts", "Contract_Number=" &
ContractNumber)
select case ClientID
case 1
strFormName = "FormForClient1"
case 2
strFormName = "FormForClient2"
case else
strFormName = "FormForOtherClients"
end select
docmd.openform strFormName
(of course you have to change my object names to yours)

-Tom.
Microsoft Access MVP


Another Question from Andrew.

I have a table [Contracts] with a field [Contract_Number], text field, no
duplicates. This table is maintained by in house (Back end). Users of the
database (Front end) fill out routine data on forms which fill up several
tables. Queries are used to compile data for reports, most of which is the
same however depending on [Client] the format of the form must change. I have
designed several forms to meet their “Particular needsâ€. Is there a way to
fire off the info to the right form (using a print form button) based on
[Contract_Number] ?

Any help as always is greatly appreciated.
.
 
Back
Top