Connecting Tech Pros Worldwide Help | Site Map

Opens forms without scroll boxes

tina.boroff@gmail.com
Guest
 
Posts: n/a
#1: Nov 13 '05
Hello Everyone, I have a database that I am plodding through (new user)
and have an issue. I have a form that has combo boxes that look up
data from another table. However, if the data (insurance company
names) is not in the drop down box we want to be able to add it. I
have set up a Not in List for this. It works fine. My problem is that
when it opens up the second form it does not offer me scroll bars and
the form actually comes up too large (the users can not even get to the
buttons at the bottom of the screen. Here is the code I am using. Any
ideas would be a major help. This is the last issue I am facing.

Private Sub InsuranceCompanyLookup_NotInList(NewData As String,
Response As _
Integer)
Dim Result
Dim Msg As String
Dim CR As String

CR = Chr$(13)

If NewData = "" Then Exit Sub
Msg = "'" & NewData & "' is not in the list." & CR & CR
Msg = Msg & "Do you want to add it?"
If MsgBox(Msg, vbQuestion + vbYesNo) = vbYes Then

DoCmd.OpenForm "CCForm", , , , acAdd, acDialog, NewDat
End If
Result = DLookup("[CompanyName]", "CCTable", _
"[CompanyName]='" & NewData & "'")
If IsNull(Result) Then
MsgBox "Please try again!"
Else
Response = acDataErrAdded
End If
End Sub

David Lloyd
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Opens forms without scroll boxes


Have you checked the ScrollBars property of the form (under the Format tab).
The form size can be adjusted in Design view.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


<tina.boroff@gmail.com> wrote in message
news:1116424603.773446.318780@g49g2000cwa.googlegr oups.com...
Hello Everyone, I have a database that I am plodding through (new user)
and have an issue. I have a form that has combo boxes that look up
data from another table. However, if the data (insurance company
names) is not in the drop down box we want to be able to add it. I
have set up a Not in List for this. It works fine. My problem is that
when it opens up the second form it does not offer me scroll bars and
the form actually comes up too large (the users can not even get to the
buttons at the bottom of the screen. Here is the code I am using. Any
ideas would be a major help. This is the last issue I am facing.

Private Sub InsuranceCompanyLookup_NotInList(NewData As String,
Response As _
Integer)
Dim Result
Dim Msg As String
Dim CR As String

CR = Chr$(13)

If NewData = "" Then Exit Sub
Msg = "'" & NewData & "' is not in the list." & CR & CR
Msg = Msg & "Do you want to add it?"
If MsgBox(Msg, vbQuestion + vbYesNo) = vbYes Then

DoCmd.OpenForm "CCForm", , , , acAdd, acDialog, NewDat
End If
Result = DLookup("[CompanyName]", "CCTable", _
"[CompanyName]='" & NewData & "'")
If IsNull(Result) Then
MsgBox "Please try again!"
Else
Response = acDataErrAdded
End If
End Sub


tina.boroff@gmail.com
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Opens forms without scroll boxes


David

THanks for the reply.

The problem is that when the form is opened normally (even out of the
switchboard) it is fine. The scroll bars that are set in the form
appear and the size is correct. The only time I have an issue with the
form is when I open it using the code I posted. I actually use this
code for 3 boxes and all of the forms open in this manner.

Thanks
Tina
David Lloyd wrote:[color=blue]
> Have you checked the ScrollBars property of the form (under the[/color]
Format tab).[color=blue]
> The form size can be adjusted in Design view.
>
> --
> David Lloyd
> MCSD .NET
> http://LemingtonConsulting.com
>
> This response is supplied "as is" without any representations or[/color]
warranties.[color=blue]
>
>
> <tina.boroff@gmail.com> wrote in message
> news:1116424603.773446.318780@g49g2000cwa.googlegr oups.com...
> Hello Everyone, I have a database that I am plodding through (new[/color]
user)[color=blue]
> and have an issue. I have a form that has combo boxes that look up
> data from another table. However, if the data (insurance company
> names) is not in the drop down box we want to be able to add it. I
> have set up a Not in List for this. It works fine. My problem is[/color]
that[color=blue]
> when it opens up the second form it does not offer me scroll bars and
> the form actually comes up too large (the users can not even get to[/color]
the[color=blue]
> buttons at the bottom of the screen. Here is the code I am using.[/color]
Any[color=blue]
> ideas would be a major help. This is the last issue I am facing.
>
> Private Sub InsuranceCompanyLookup_NotInList(NewData As String,
> Response As _
> Integer)
> Dim Result
> Dim Msg As String
> Dim CR As String
>
> CR = Chr$(13)
>
> If NewData = "" Then Exit Sub
> Msg = "'" & NewData & "' is not in the list." & CR & CR
> Msg = Msg & "Do you want to add it?"
> If MsgBox(Msg, vbQuestion + vbYesNo) = vbYes Then
>
> DoCmd.OpenForm "CCForm", , , , acAdd, acDialog, NewDat
> End If
> Result = DLookup("[CompanyName]", "CCTable", _
> "[CompanyName]='" & NewData & "'")
> If IsNull(Result) Then
> MsgBox "Please try again!"
> Else
> Response = acDataErrAdded
> End If
> End Sub[/color]

Jana
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Opens forms without scroll boxes


Tina:

Your problem lies in the acDialog argument in your OpenForm line. This
argument changes the form to open in a special way that changes how it
looks and works. Take a look at the OpenForm Action and the Modal and
PopUp properties in help for more details. You can change the argument
to acWindowNormal to open the form normally, but that mode doesn't
force the user to fill out the form before they can continue. You'll
have to look at the pros and cons to decide which way to go.

Jana

tina.boroff@gmail.com
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Opens forms without scroll boxes


THanks so much Jana...I will give it a try.

Jana
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Opens forms without scroll boxes


No problem, good luck!

Closed Thread