Click here to Skip to main content
15,914,452 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Tab page issues Pin
Christian Graus9-Jan-06 12:45
protectorChristian Graus9-Jan-06 12:45 
GeneralRe: Tab page issues Pin
eatwork12-Jan-06 6:06
eatwork12-Jan-06 6:06 
QuestionShutdown Parameters Pin
Adam6669-Jan-06 9:34
Adam6669-Jan-06 9:34 
AnswerRe: Shutdown Parameters Pin
ToddHileHoffer9-Jan-06 10:02
ToddHileHoffer9-Jan-06 10:02 
GeneralRe: Shutdown Parameters Pin
Colin Angus Mackay9-Jan-06 12:07
Colin Angus Mackay9-Jan-06 12:07 
AnswerRe: Shutdown Parameters Pin
Colin Angus Mackay9-Jan-06 12:06
Colin Angus Mackay9-Jan-06 12:06 
AnswerRe: Shutdown Parameters Pin
Dave Kreskowiak9-Jan-06 12:15
mveDave Kreskowiak9-Jan-06 12:15 
QuestionFinding records matching values between 2 parameterized values? Pin
Erwin_Br9-Jan-06 9:12
Erwin_Br9-Jan-06 9:12 
I'm creating a small room reservation program in which the user can reserve a room number for a certain amount of time on a certain date.

Let's say room 2 is reserved on 3-3-2006 between 7:00 and 11:00. How can I prevent users from placing a reservation with a starting time, or an ending time, between 7 and 11? They shouldn't be allowed to make a reservation from 8:00 till 9:00, neither should they from 10:00 till 12:00.

I've tried everything, but I have no clue. The only thing I have so far is code that checks whether an exact record exists. So if someone already reserved room 2 on 3-3-2006 at 7:00 till 11:00, an error will show.

I've tried something like this:

SELECT StartTime, EndTime, Date, Comment, Room, PersonID, ID<br />
FROM tblReserveringen<br />
WHERE (StartTime BETWEEN '13:00' AND '14:00') AND (Room= ?) AND (Date= ?)<br />
OR (EndTime BETWEEN '13:00' AND '14:00') AND (Room= ?) AND (Date= ?)<br />


As you can see, I tried to work with parameters. When a record matching the conditions is found, the submission is cancelled. Now if only I could make those time cells variable with parameters, like the rest of -em! Something like:

SELECT StartTime, EndTime, Date, Comment, Room, PersonID, ID<br />
FROM tblReserveringen<br />
WHERE (StartTime BETWEEN (StartTime= ?) AND (EndTime= ?)) AND (Room= ?) AND (Date= ?)<br />
OR (EndTime BETWEEN (StartTime= ?) AND (EndTime= ?)) AND (Room= ?) AND (Date= ?)<br />


Unfortuately, above code does not work (the first example does). Is it even possible what I want?

Any help is greatly appreciated. Big Grin | :-D

--Erwin
QuestionLooping enum elements? Pin
matsnas9-Jan-06 2:34
matsnas9-Jan-06 2:34 
AnswerRe: Looping enum elements? Pin
Duncan Edwards Jones9-Jan-06 3:15
professionalDuncan Edwards Jones9-Jan-06 3:15 
GeneralRe: Looping enum elements? Pin
matsnas9-Jan-06 3:24
matsnas9-Jan-06 3:24 
AnswerRe: Looping enum elements? Pin
J4amieC9-Jan-06 3:19
J4amieC9-Jan-06 3:19 
Questionresizing the width of columns in datagrid with datatable Pin
Pravin H9-Jan-06 0:52
Pravin H9-Jan-06 0:52 
AnswerRe: resizing the width of columns in datagrid with datatable Pin
Dave Kreskowiak9-Jan-06 5:08
mveDave Kreskowiak9-Jan-06 5:08 
GeneralRe: resizing the width of columns in datagrid with datatable Pin
Pravin H9-Jan-06 20:08
Pravin H9-Jan-06 20:08 
GeneralRe: resizing the width of columns in datagrid with datatable Pin
Dave Kreskowiak10-Jan-06 2:55
mveDave Kreskowiak10-Jan-06 2:55 
GeneralRe: resizing the width of columns in datagrid with datatable Pin
Pravin H10-Jan-06 6:49
Pravin H10-Jan-06 6:49 
GeneralRe: resizing the width of columns in datagrid with datatable Pin
Dave Kreskowiak10-Jan-06 12:16
mveDave Kreskowiak10-Jan-06 12:16 
GeneralRe: resizing the width of columns in datagrid with datatable Pin
Pravin H11-Jan-06 6:40
Pravin H11-Jan-06 6:40 
GeneralRe: resizing the width of columns in datagrid with datatable Pin
Dave Kreskowiak11-Jan-06 11:01
mveDave Kreskowiak11-Jan-06 11:01 
GeneralRe: resizing the width of columns in datagrid with datatable Pin
Pravin H12-Jan-06 0:25
Pravin H12-Jan-06 0:25 
QuestionVBA Doubt Pin
<color>Aljechin 8-Jan-06 23:54
<color>Aljechin 8-Jan-06 23:54 
AnswerRe: VBA Doubt Pin
Curtis Schlak.9-Jan-06 2:00
Curtis Schlak.9-Jan-06 2:00 
GeneralRe: VBA Doubt Pin
<color>Aljechin 9-Jan-06 20:14
<color>Aljechin 9-Jan-06 20:14 
QuestionVB.Net Naming Convention Pin
GaneshParam8-Jan-06 23:13
GaneshParam8-Jan-06 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.