Navigating object properties is very basic Access functionality. Get familiar with the organization of the Properties sheet.
Navigating object properties is very basic Access functionality. Get familiar with the organization of the Properties sheet.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes finally
Thank You Guys so much
I have been struggling with this for a long time and you guys helped me solve it instantly
Thank You So Much
Owe You Guys Big Time!!!!!
I suggest you study the code and also the various results it may produce. There are a lot of If then Else statements that when certain criteria is met, different results happen. I would do extensive testing by trying to create different scenarios where each If Then statement’s results are tested.
Hey Guys
I finally solved it thanks to your help
I really owe it you guys thanks for all the help
I had been struggling with this for weeks
Actually hold on guys
How comes the option is till there once it is selected
how do i enter code so that when the option is selected it is no longer shown in the combo box
Hey Guys i just realised that there is something wrong
the option is still available once it is selected.
what code do i need to enter to ensure that the option is not shown in the list once it has been selected by the user for that certain day
eg:-
someone is booked at 12:00 Pm
how do I remove the 12:00 Pm Slot from the combo box so that it can not accidentally be selected again by the user
Selecting an item from combobox list does not naturally remove the item. That requires some more complex code (or complicated query if the RowSource is based on a query - yours is not).
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I took a look at the video and you need the second loop.
Also, there are before update and after update events for the combos tht you will need. Didn't study that code. The video is just painfully slow for me to watch.Code:Dim i As Date, n As Integer, oRS As DAO.Recordset Dim sSQL As String, dDuration As Date Dim dLowerbreak As Date, dUpperBreak As Date cboTime.RowSourceType = "Value List" cboTime.RowSource = "" 'If IsNull(Start) Then Exit Sub Else i = Start If IsNull(Me.Start) Then Exit Sub Else i = Me.Start If Me.NewRecord = True Then DoCmd.RunCommand acCmdSaveRecord End If sSQL = "SELECT DoctorsID,AppointDate,AppointTime" sSQL = sSQL & " FROM qrySubformAppoints" sSQL = sSQL & " WHERE DoctorsID=" & Me.id & _ " AND AppointDate=#" & Me.txtAppointDate & "#" Set oRS = CurrentDb.OpenRecordset(sSQL) dDuration = TimeValue("00:30") dLowerbreak = Break - TimeValue("00:25") 'Break is a field dUpperBreak = Break + TimeValue("00:25") If oRS.RecordCount = 0 Then Do If i <= dLowerbreak Or i >= dUpperBreak Then cboTime.AddItem i End If i = i + dDuration Loop Until i >= txtEnd Else Do If i <= dLowerbreak Or i >= dUpperBreak Then oRS.FindFirst "[AppointTime] Between #" & i - TimeValue("00:00:05") & _ "# And #" & i + TimeValue("00:00:05") & "#" If oRS.NoMatch Then cboTime.AddItem i End If Loop Until i >= txtEnd End If oRS.Close Set oRS = Nothing
so does that above code mean that the option ill be gone once it has been selected
what code is required to make the combo box work in a way that the option is removed from the list once it is selected by the user so that it can not be accidentaly entered again by the user
hey guys can any of you help me out create the code so that it does what i said in previous posts
Might be the BeforeUpdate and AfterUpdate code that ItsMe indicated is in the video. I won't be able to watch it to find out.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
sorry what do you mean
ItsMe said (see post 24) there was more code in that YouTube video that was placed into the BeforeUpdate and AfterUpdate events of the combobox and indicated you would need that code also.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I see you started another thread on this topic https://www.accessforums.net/access/...elp-40469.html
If your original question is resolved, then I consider this thread closed.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.