Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Form & combo box question

Peter,

I can't remeber who developed this originally but it was an update function
that saved me.

I have mucked around with the original code.

All that happens in this is once you load in the data record you want, then
add the new data (or change existing data) and then when activated the code
determines if the staff names exists and then adds or replaces the data.


Sub StaffDetialsUpdate()
Dim rng As Range
Dim idex As Long

'determines if the staffname alread exists in the list
If Staff.StaffNames.ListIndex = -1 Then
'if the staff name doesn't exist in the list then tell them to use the add
fucntion
MsgBox "This is a new entry - try ADD"
Else
'get the staff name
idex = Staff.StaffNames.ListIndex
'find range for staff names in database
Set rng = Worksheets("staff database").Range("A1")
Set rng = rng(Staff.StaffNames.List(idex, 1))
'rng for data to be posted from which enterypoints in the Staff form
rng(1, 2).Value = Staff.Proposed.Value
rng(1, 3).Value = Staff.Title.Text
'could use a loop depending on names
End if

End Sub







"Peter" wrote in message
...
On Wed, 6 Oct 2004 23:41:13 +0100, "Bob Phillips"
wrote:

Peter,

Not the answer to your question, but have you looked at DataForm, it
allows
managing a dataset very easily.


Hi Bob,

Yes, I've used Data|Form previously, but in this instance I need to
enter some data in a form and have that data entered into an existing
row in a spreadsheet

i.e. Cells S1:S7 already have data in them. My form would select row 7
by virtue of the unique reference in cell S1 and the data in my form
would then be added to cells S8:S15.


--
Cheers

Peter

Remove the INVALID to reply



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
combo box - VBA form Roy Gudgeon[_2_] Excel Discussion (Misc queries) 3 March 15th 10 12:20 PM
linking a form combo box... results from the combo box to another Trey Excel Discussion (Misc queries) 1 July 15th 07 01:58 AM
combo boxes on a form Russell-stanely Excel Discussion (Misc queries) 3 July 5th 05 09:13 PM
VBA Form Combo Box question. WTG Excel Discussion (Misc queries) 3 February 26th 05 04:28 PM
Form Combo Box Jeff Excel Discussion (Misc queries) 1 December 15th 04 04:10 PM


All times are GMT +1. The time now is 11:25 PM.

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

About Us

"It's about Microsoft Excel"