Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Form/Input box problem

Dear all
I hope someone can help me with the following couple of problems.

I have created a spreadsheet to record the use of our telephone system,
number of calls, reason, operator etc, to make things easier I have created
a user form which is displayed from a Command Button on the worksheet. What
I am trying to achieve is:-
1) Display a input box when the work book is first opened prompting the user
to enter their name. The inputed name is 'saved' so that when the user form
is called up the name is already entered into a text box. Once the various
text boxes and option buttons have been completed the details are saved to
the spreadsheet, including the staff members name, and the user form
dismissed again from a command button on the user form but the operators
name is still available for use when the user form is called up again. Which
brings me onto the second problem: -
2) The workbook is shared between up to 17 users, I can write the code so
that as the user form is called up it automatically does a save so that it
picks any additions saved by other users but how do I automatically accept
any changes that have been made rather than having to click on the button to
accept the changes?

We are using Windows 2K and Office 2000

Any assistance would be gratefully received


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default User Form/Input box problem

Hi Peter,

First point. Don't bother with the in put box, get the users login id with
this code

Public Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long

Public Function UserName() As String
Dim sName As String * 256
Dim cChars As Long
cChars = 256
If GetUserName(sName, cChars) Then
UserName = Left$(sName, cChars - 1)
End If
End Function

You can call UserName in the Workbok_Open event, and save it tgo a global
variable.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Peter" wrote in message
...
Dear all
I hope someone can help me with the following couple of

problems.

I have created a spreadsheet to record the use of our telephone system,
number of calls, reason, operator etc, to make things easier I have

created
a user form which is displayed from a Command Button on the worksheet.

What
I am trying to achieve is:-
1) Display a input box when the work book is first opened prompting the

user
to enter their name. The inputed name is 'saved' so that when the user

form
is called up the name is already entered into a text box. Once the various
text boxes and option buttons have been completed the details are saved to
the spreadsheet, including the staff members name, and the user form
dismissed again from a command button on the user form but the operators
name is still available for use when the user form is called up again.

Which
brings me onto the second problem: -
2) The workbook is shared between up to 17 users, I can write the code so
that as the user form is called up it automatically does a save so that it
picks any additions saved by other users but how do I automatically accept
any changes that have been made rather than having to click on the button

to
accept the changes?

We are using Windows 2K and Office 2000

Any assistance would be gratefully received




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to select a specific range based on the time value of user form input Jitranijam New Users to Excel 8 November 15th 06 12:52 AM
Trouble with saving user input in an Excel Form. University of Maine student Excel Discussion (Misc queries) 0 March 14th 06 07:31 PM
create a user input form Travis Excel Programming 2 January 6th 04 04:13 PM
Detecting Input Change on User Form Don Wiss Excel Programming 3 December 2nd 03 02:09 AM
Help with a User Input Form Cody Dawg[_2_] Excel Programming 3 October 9th 03 10:08 PM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"